Skip to content

Commit 3dfb676

Browse files
authored
Merge pull request IvorySQL#999 from OreoYang/CI_warning
Master: clean some build warnings and CI not ignore warning, with make CFLAGS
2 parents 7261f1c + 30ce895 commit 3dfb676

File tree

24 files changed

+80
-76
lines changed

24 files changed

+80
-76
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ jobs:
1919
if: ${{ matrix.os == 'ubuntu-latest' }}
2020
run: |
2121
sudo apt-get update
22+
sudo apt-get install -y gcc-14 g++-14
23+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100
24+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100
2225
sudo apt-get install -y build-essential git lcov bison flex \
2326
libkrb5-dev libssl-dev libldap-dev libpam-dev python3-dev \
2427
tcl-dev libperl-dev gettext libxml2-dev libxslt-dev \
@@ -35,4 +38,4 @@ jobs:
3538
--with-ossp-uuid --with-libxml --with-libxslt --with-perl \
3639
--with-icu --with-libnuma --enable-injection-points
3740
- name: compile
38-
run: make
41+
run: make CFLAGS="$CFLAGS -Wshadow=compatible-local -Werror=missing-variable-declarations -Werror=maybe-uninitialized -Werror=unused-value -Werror=unused-but-set-variable -Werror=missing-prototypes -Werror=unused-variable"

contrib/gb18030_2022/utf8_and_gb18030_2022.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222

2323
PG_MODULE_MAGIC;
2424

25-
gb18030_2022_to_utf8_hook_type pre_gb18030_2022_to_utf8_hook = NULL;
26-
utf8_to_gb18030_2022_hook_type pre_utf8_to_gb18030_2022_hook = NULL;
25+
static gb18030_2022_to_utf8_hook_type pre_gb18030_2022_to_utf8_hook = NULL;
26+
static utf8_to_gb18030_2022_hook_type pre_utf8_to_gb18030_2022_hook = NULL;
2727

2828
int gb18030_2022_to_utf8(const unsigned char *iso, int len,
2929
unsigned char *utf, bool noError);

contrib/ivorysql_ora/src/builtin_functions/datetime_datatype_functions.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ static const int month_days[] = {
153153
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
154154
};
155155

156-
const char *const ora_days[] = {"Sunday", "Monday", "Tuesday", "Wednesday",
156+
static const char *const ora_days[] = {"Sunday", "Monday", "Tuesday", "Wednesday",
157157
"Thursday", "Friday", "Saturday", NULL};
158158

159159
#define CASE_fmt_YYYY case 0: case 1: case 2: case 3: case 4: case 5: case 6:
@@ -169,7 +169,7 @@ const char *const ora_days[] = {"Sunday", "Monday", "Tuesday", "Wednesday",
169169
#define CASE_fmt_HH case 27: case 28: case 29:
170170
#define CASE_fmt_MI case 30:
171171

172-
const char *const date_fmt[] =
172+
static const char *const date_fmt[] =
173173
{
174174
"Y", "Yy", "Yyy", "Yyyy", "Year", "Syyyy", "syear",
175175
"I", "Iy", "Iyy", "Iyyy",
@@ -195,7 +195,7 @@ const char *const date_fmt[] =
195195
#define CASE_timezone_10 case 15: case 16:
196196
#define CASE_timezone_11 case 17:
197197

198-
const char *const date_timezone[] =
198+
static const char *const date_timezone[] =
199199
{
200200
"GMT", "ADT", "NST", "AST", "EDT", "CDT",
201201
"EST", "CST", "MDT", "MST", "PDT", "PST",

contrib/uuid-ossp/uuid-ossp.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,11 @@ ora_sys_guid(PG_FUNCTION_ARGS)
565565
#ifdef HAVE_UUID_OSSP
566566
uuid_t *uuid;
567567
uuid_rc_t rc;
568+
#elif defined(HAVE_UUID_E2FS)
569+
uuid_t uu;
570+
#else /* BSD */
571+
int i;
572+
unsigned char byte_array[SYS_GUID_LENGTH];
568573
#endif
569574

570575
result = (bytea *)palloc(VARHDRSZ + SYS_GUID_LENGTH);
@@ -579,13 +584,10 @@ ora_sys_guid(PG_FUNCTION_ARGS)
579584
memcpy(VARDATA(result), (unsigned char *)uuid, SYS_GUID_LENGTH);
580585

581586
#elif defined(HAVE_UUID_E2FS)
582-
uuid_t uu;
583587
uuid_generate_random(uu);
584588
memcpy(VARDATA(result), uu, SYS_GUID_LENGTH);
585589

586590
#else /* BSD */
587-
int i;
588-
unsigned char byte_array[SYS_GUID_LENGTH];
589591
for (i = 0; i < SYS_GUID_LENGTH; i++) {
590592
byte_array[i] = (unsigned char)arc4random();
591593
}

src/backend/access/transam/xlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
#include "utils/memutils.h"
109109
#endif
110110

111-
extern int bootstrap_database_mode;
111+
112112
/* timeline ID to be used when bootstrapping */
113113
#define BootstrapTimeLineID 1
114114

src/backend/commands/sequence.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ typedef struct SeqTableData
9696
typedef SeqTableData *SeqTable;
9797

9898
static HTAB *seqhashtab = NULL; /* hash table for SeqTable items */
99-
int64 session_id = 0;
100-
int32 scale_value = 0;
99+
static int64 session_id = 0;
100+
static int32 scale_value = 0;
101101

102102
/*
103103
* last_used_seq is updated by nextval() to point to the last used
@@ -2399,7 +2399,7 @@ process_owned_by(Relation seqrel, List *owned_by, bool for_identity)
23992399
DependencyType deptype;
24002400
int nnames;
24012401
Relation tablerel;
2402-
AttrNumber attnum;
2402+
AttrNumber attnum = InvalidAttrNumber;
24032403
char *seqname;
24042404

24052405
deptype = for_identity ? DEPENDENCY_INTERNAL : DEPENDENCY_AUTO;

src/backend/commands/tablecmds.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15642,7 +15642,7 @@ RememberAllDependentForRebuilding(AlteredTableInfo *tab, AlterTableType subtype,
1564215642
ScanKeyData key[3];
1564315643
SysScanDesc scan;
1564415644
HeapTuple depTup;
15645-
ObjectFunOrPkg *dependentFuncPkgOids;
15645+
ObjectFunOrPkg *dependentFuncPkgOids = NULL;
1564615646
bool FuncPkgDepend = false;
1564715647

1564815648
if(NULL != numDependentFuncPkgOids &&
@@ -15653,6 +15653,7 @@ RememberAllDependentForRebuilding(AlteredTableInfo *tab, AlterTableType subtype,
1565315653
dependentFuncPkgOids = *dependentFuncPkg;
1565415654
}
1565515655

15656+
1565615657
Assert(subtype == AT_AlterColumnType || subtype == AT_SetExpression);
1565715658

1565815659
depRel = table_open(DependRelationId, RowExclusiveLock);

src/backend/executor/execExpr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5112,7 +5112,7 @@ ExecInitFuncWithOutParams(Expr *node, ExprState *state,
51125112
{
51135113
FuncExpr *funcexpr = (FuncExpr *) node;
51145114
Oid funcOid = funcexpr->funcid;
5115-
HeapTuple func_tuple;
5115+
HeapTuple func_tuple = NULL;
51165116
Oid *argtypes = NULL;
51175117
char **argnames = NULL;
51185118
char *argmodes = NULL;

src/backend/oracle_parser/liboracle_parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ PG_MODULE_MAGIC_EXT(
4949
static raw_parser_hook_type prev_raw_parser = NULL;
5050
static get_keywords_hook_type prev_pg_get_keywords = NULL;
5151
static fill_in_constant_lengths_hook_type prev_fill_in_contant_lengths = NULL;
52-
quote_identifier_hook_type prev_quote_identifier = NULL;
52+
static quote_identifier_hook_type prev_quote_identifier = NULL;
5353

5454
void _PG_init(void);
5555
void _PG_fini(void);

src/backend/parser/parse_param.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ typedef struct OraParamNumbers
7171
struct OraParamNumbers* prev;
7272
}OraParamNumbers;
7373

74-
OraParamNumbers *TopOraParamNode = NULL;
75-
OraParamNumbers *CurrentOraParamNode = NULL;
74+
static OraParamNumbers *TopOraParamNode = NULL;
75+
static OraParamNumbers *CurrentOraParamNode = NULL;
7676

7777
/*
7878
* dynamic sql stmt parse information

0 commit comments

Comments
 (0)