Changeset: 3afd6b9f2b9c for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3afd6b9f2b9c
Modified Files:
clients/odbc/samples/arraytest.c
clients/odbc/samples/odbcsample1.c
clients/odbc/samples/testgetinfo.c
gdk/gdk_search.c
monetdb5/mal/mal_function.c
monetdb5/mal/mal_parser.c
monetdb5/modules/atoms/inet.c
sql/backends/monet5/UDF/pyapi/unicode.c
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql_statement.c
sql/backends/monet5/sql_statistics.c
sql/server/rel_exp.c
sql/server/rel_optimizer.c
sql/server/rel_planner.c
sql/server/rel_rel.c
sql/server/rel_select.c
tools/merovingian/client/monetdb.c
tools/merovingian/utils/glob.c
Branch: Jul2017
Log Message:
Ported to GCC 7.1.1 which uses -Wimplicit-fallthough=3 when using -Wextra.
There must be a quite particular comment or __attribute__ as the last
thing before the next case/default label when the code falls through.
(Merge with Dec2016 branch.)
diffs (truncated from 334 to 300 lines):
diff --git a/clients/odbc/samples/arraytest.c b/clients/odbc/samples/arraytest.c
--- a/clients/odbc/samples/arraytest.c
+++ b/clients/odbc/samples/arraytest.c
@@ -36,6 +36,7 @@ prerr(SQLSMALLINT tpe, SQLHANDLE hnd, co
case SQL_SUCCESS_WITH_INFO:
if (msglen >= (signed int) sizeof msg)
fprintf(stderr, "(message truncated)\n");
+ /* fall through */
case SQL_SUCCESS:
fprintf(stderr,
"%s: %s: SQLstate %s, Errnr %d, Message %s\n",
diff --git a/clients/odbc/samples/odbcsample1.c
b/clients/odbc/samples/odbcsample1.c
--- a/clients/odbc/samples/odbcsample1.c
+++ b/clients/odbc/samples/odbcsample1.c
@@ -34,6 +34,7 @@ prerr(SQLSMALLINT tpe, SQLHANDLE hnd, co
case SQL_SUCCESS_WITH_INFO:
if (msglen >= (signed int) sizeof(msg))
fprintf(stderr, "(message truncated)\n");
+ /* fall through */
case SQL_SUCCESS:
fprintf(stderr, "%s: %s: SQLstate %s, Errnr %d, Message %s\n",
func, pref, (char*)state, (int)errnr, (char*)msg);
break;
diff --git a/clients/odbc/samples/testgetinfo.c
b/clients/odbc/samples/testgetinfo.c
--- a/clients/odbc/samples/testgetinfo.c
+++ b/clients/odbc/samples/testgetinfo.c
@@ -31,6 +31,7 @@ prerr(SQLSMALLINT tpe, SQLHANDLE hnd, co
case SQL_SUCCESS_WITH_INFO:
if (msglen >= (signed int) sizeof(msg))
fprintf(stderr, "(message truncated)\n");
+ /* fall through */
case SQL_SUCCESS:
fprintf(stderr, "%s: %s: SQLstate %s, Errnr %d, Message %s\n",
func, pref, (char*)state, (int)errnr, (char*)msg);
break;
diff --git a/monetdb5/mal/mal_function.c b/monetdb5/mal/mal_function.c
--- a/monetdb5/mal/mal_function.c
+++ b/monetdb5/mal/mal_function.c
@@ -179,6 +179,7 @@ void chkFlow(stream *out, MalBlkPtr mb)
}
yieldseen= TRUE;
}
+ /* fall through */
case RETURNsymbol:
{
InstrPtr ps = getInstrPtr(mb, 0);
diff --git a/monetdb5/mal/mal_parser.c b/monetdb5/mal/mal_parser.c
--- a/monetdb5/mal/mal_parser.c
+++ b/monetdb5/mal/mal_parser.c
@@ -380,6 +380,7 @@ cstToken(Client cntxt, ValPtr cst)
case '-':
i++;
s++;
+ /* fall through */
case '0':
if ((s[1] == 'x' || s[1] == 'X')) {
/* deal with hex */
@@ -387,6 +388,7 @@ cstToken(Client cntxt, ValPtr cst)
i += 2;
s += 2;
}
+ /* fall through */
case '1': case '2': case '3': case '4': case '5':
case '6': case '7': case '8': case '9':
if (hex)
@@ -405,6 +407,7 @@ cstToken(Client cntxt, ValPtr cst)
if (hex)
goto handleInts;
+ /* fall through */
case '.':
if (*s == '.' && isdigit(*(s + 1))) {
i++;
@@ -1934,6 +1937,7 @@ parseMAL(Client cntxt, Symbol curPrg, in
cntrl = YIELDsymbol;
goto allLeft;
}
+ /* fall through */
default: allLeft :
parseAssign(cntxt, cntrl);
cntrl = 0;
diff --git a/monetdb5/modules/atoms/inet.c b/monetdb5/modules/atoms/inet.c
--- a/monetdb5/modules/atoms/inet.c
+++ b/monetdb5/modules/atoms/inet.c
@@ -170,8 +170,10 @@ INETfromString(const char *src, int *len
switch (type) {
case 1:
(*retval)->q2 = (unsigned char)
0;
+ /* fall through */
case 2:
(*retval)->q3 = (unsigned char)
0;
+ /* fall through */
case 3:
(*retval)->q4 = (unsigned char)
0;
break;
diff --git a/sql/backends/monet5/UDF/pyapi/unicode.c
b/sql/backends/monet5/UDF/pyapi/unicode.c
--- a/sql/backends/monet5/UDF/pyapi/unicode.c
+++ b/sql/backends/monet5/UDF/pyapi/unicode.c
@@ -187,10 +187,12 @@ int utf8_char_to_utf32_char(size_t posit
if (bytes[3] > 0xc0)
return -1; // invalid utf8 character, the
maximum value of the
// second, third and fourth
bytes is 0xbf
+ /* fall through */
case 3:
bytes[2] = utf8_char[offset + 2];
if (bytes[2] > 0xc0)
return -1;
+ /* fall through */
case 2:
bytes[1] = utf8_char[offset + 1];
if (bytes[1] > 0xc0)
diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -1330,6 +1330,7 @@ rel2bin_args(backend *be, sql_rel *rel,
case op_groupby:
if (rel->r)
args = exps2bin_args(be, rel->r, args);
+ /* fall through */
case op_project:
case op_select:
case op_topn:
diff --git a/sql/backends/monet5/sql_statement.c
b/sql/backends/monet5/sql_statement.c
--- a/sql/backends/monet5/sql_statement.c
+++ b/sql/backends/monet5/sql_statement.c
@@ -2131,12 +2131,15 @@ stmt_catalog(backend *be, int type, stmt
case DDL_DROP_SEQ: q = newStmt(mb, sqlcatalogRef, drop_seqRef);
break;
case DDL_CREATE_SCHEMA: q = newStmt(mb, sqlcatalogRef,
create_schemaRef); break;
case DDL_DROP_SCHEMA_IF_EXISTS: if_exists =1;
+ /* fall through */
case DDL_DROP_SCHEMA: q = newStmt(mb, sqlcatalogRef, drop_schemaRef);
break;
case DDL_CREATE_TABLE: q = newStmt(mb, sqlcatalogRef,
create_tableRef); break;
case DDL_CREATE_VIEW: q = newStmt(mb, sqlcatalogRef, create_viewRef);
break;
case DDL_DROP_TABLE_IF_EXISTS: if_exists =1;
+ /* fall through */
case DDL_DROP_TABLE: q = newStmt(mb, sqlcatalogRef, drop_tableRef);
break;
case DDL_DROP_VIEW_IF_EXISTS: if_exists = 1;
+ /* fall through */
case DDL_DROP_VIEW: q = newStmt(mb, sqlcatalogRef, drop_viewRef);
break;
case DDL_DROP_CONSTRAINT: q = newStmt(mb, sqlcatalogRef,
drop_constraintRef); break;
case DDL_ALTER_TABLE: q = newStmt(mb, sqlcatalogRef, alter_tableRef);
break;
diff --git a/sql/backends/monet5/sql_statistics.c
b/sql/backends/monet5/sql_statistics.c
--- a/sql/backends/monet5/sql_statistics.c
+++ b/sql/backends/monet5/sql_statistics.c
@@ -86,8 +86,10 @@ sql_analyze(Client cntxt, MalBlkPtr mb,
switch (argc) {
case 6:
col = *getArgReference_str(stk, pci, 5);
+ /* fall through */
case 5:
tbl = *getArgReference_str(stk, pci, 4);
+ /* fall through */
case 4:
sch = *getArgReference_str(stk, pci, 3);
}
diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c
--- a/sql/server/rel_exp.c
+++ b/sql/server/rel_exp.c
@@ -1211,6 +1211,7 @@ rel_find_exp_( sql_rel *rel, sql_exp *e)
}
return ne;
}
+ /* fall through */
case e_cmp:
case e_psm:
return NULL;
diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c
--- a/sql/server/rel_optimizer.c
+++ b/sql/server/rel_optimizer.c
@@ -1418,6 +1418,7 @@ can_push_func(sql_exp *e, sql_rel *rel,
if (rel && !rel_find_exp(rel, e))
return 0;
(*must) = 1;
+ /* fall through */
case e_atom:
default:
return 1;
@@ -2490,6 +2491,7 @@ exp_find_math_unsafe( sql_exp *e)
return 1;
}
}
+ /* fall through */
case e_convert:
return exp_find_math_unsafe(e->l);
case e_column:
@@ -5144,6 +5146,7 @@ split_aggr_and_project(mvc *sql, list *a
return e;
case e_func:
list_split_aggr_and_project(sql, aexps, e->l);
+ return e;
case e_column: /* constants and columns shouldn't be rewriten */
case e_atom:
case e_psm:
@@ -5770,6 +5773,7 @@ rel_mark_used(mvc *sql, sql_rel *rel, in
rel_mark_used(sql, rel, proj);
break;
}
+ /* fall through */
case op_project:
case op_groupby:
if (proj && rel->l) {
@@ -6069,6 +6073,7 @@ rel_dce_down(mvc *sql, sql_rel *rel, lis
rel->l = rel_dce_down(sql, rel->l, refs, 0);
if (!skip_proj)
rel_dce_sub(sql, rel, refs);
+ /* fall through */
case op_insert:
case op_ddl:
@@ -6247,6 +6252,7 @@ index_exp(sql_exp *e, sql_idx *i)
case oph_idx:
if (e->flag == cmp_equal)
return 0;
+ /* fall through */
case join_idx:
default:
return -1;
@@ -8156,6 +8162,7 @@ rel_find_conflicts(mvc *sql, sql_rel *re
case op_basetable:
case op_table:
exps_mark_conflicts(sql, rel->exps, conflicts, 1);
+ return rel;
case op_topn:
case op_sample:
return rel;
diff --git a/sql/server/rel_planner.c b/sql/server/rel_planner.c
--- a/sql/server/rel_planner.c
+++ b/sql/server/rel_planner.c
@@ -197,6 +197,7 @@ exp_getdcount( mvc *sql, sql_rel *r , sq
case e_convert:
if (e->l)
return exp_getdcount(sql, r, e->l, count);
+ /* fall through */
case e_func:
case e_aggr:
case e_atom:
@@ -224,6 +225,7 @@ exp_getranges( mvc *sql, sql_rel *r , sq
case e_convert:
if (e->l)
return exp_getranges(sql, r, e->l, min, max);
+ /* fall through */
case e_func:
case e_aggr:
case e_atom:
@@ -434,6 +436,7 @@ rel_getsel(mvc *sql, sql_rel *rel, lng c
case op_project:
if (rel->l)
return rel_getsel(sql, rel->l, count);
+ /* fall through */
default:
return 1.0;
}
diff --git a/sql/server/rel_rel.c b/sql/server/rel_rel.c
--- a/sql/server/rel_rel.c
+++ b/sql/server/rel_rel.c
@@ -224,6 +224,7 @@ rel_bind_column_(mvc *sql, sql_rel **p,
*p = rel;
if (rel->l)
return rel_bind_column_(sql, p, rel->l, cname);
+ /* fall through */
default:
return NULL;
}
@@ -894,6 +895,7 @@ rel_bind_path_(sql_rel *rel, sql_exp *e,
assert(0);
break;
}
+ /* fall through */
case op_groupby:
case op_project:
case op_table:
diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -99,6 +99,7 @@ rel_table_projections( mvc *sql, sql_rel
if (exps && list_length(exps))
return exps;
}
+ /* fall through */
default:
return NULL;
}
diff --git a/tools/merovingian/client/monetdb.c
b/tools/merovingian/client/monetdb.c
--- a/tools/merovingian/client/monetdb.c
+++ b/tools/merovingian/client/monetdb.c
@@ -707,6 +707,7 @@ command_status(int argc, char *argv[])
i = argc;
break;
}
+ /* fall through */
default:
fprintf(stderr, "status:
unknown option: -%c\n", *p);
command_help(2, &argv[-1]);
@@ -1011,6 +1012,7 @@ command_startstop(int argc, char *argv[]
i = argc;
break;
}
+ /* fall through */
default:
fprintf(stderr, "%s: unknown
option: -%c\n", type, *p);
command_help(2, &argv[-1]);
@@ -1115,6 +1117,7 @@ command_set(int argc, char *argv[], mero
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list