Changeset: c8779e98c5d8 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c8779e98c5d8
Modified Files:
configure.ag
gdk/gdk_setop.mx
monetdb5/mal/mal_instruction.mx
monetdb5/modules/kernel/aggr_bge_count.mx
monetdb5/modules/mal/mal_mapi.mx
sql/server/rel_schema.c
Branch: Apr2011
Log Message:
removed dead code / unreachable statements
and made icc treat #111 "statement is unreachable" as error
diffs (98 lines):
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -642,6 +642,8 @@
X_CFLAGS="$X_CFLAGS -we181"
dnl Let remark #810 "conversion from "." to "." may lose significant
bits" become an error.
X_CFLAGS="$X_CFLAGS -we810"
+ dnl Let remark #111 "statement is unreachable" become an error.
+ X_CFLAGS="$X_CFLAGS -we111"
dnl Let remark #271: "trailing comma is nonstandard" become an error.
X_CFLAGS="$X_CFLAGS -we271"
X_CFLAGS="$X_CFLAGS -Werror"
@@ -664,7 +666,6 @@
dnl #1419: external declaration in primary source file
dnl # 981: operands are evaluated in unspecified order
dnl # 193: zero used for undefined preprocessing identifier
- dnl # 111: statement is unreachable
dnl #1357: optimization disabled due to excessive resource
requirements; contact Intel Premier Support for assistance
dnl #1572: floating-point equality and inequality comparisons are
unreliable
dnl #1599: declaration hides variable
diff --git a/gdk/gdk_setop.mx b/gdk/gdk_setop.mx
--- a/gdk/gdk_setop.mx
+++ b/gdk/gdk_setop.mx
@@ -453,6 +453,11 @@
HIT@1(h, t);
break;
}
+#if @5 != k
+/* Otherwise, icc complains about */
+/* "error #111: statement is unreachable" */
+/* at "if ((++pb) >= q2) {" */
+/* due to "#define EQUALk(t1,t2) TRUE". */
if ((++pb) >= q2) {
MISS@1(h, t);
break;
@@ -462,6 +467,7 @@
MISS@1(h, t);
break;
}
+#endif
}
continue;
}
diff --git a/monetdb5/mal/mal_instruction.mx b/monetdb5/mal/mal_instruction.mx
--- a/monetdb5/mal/mal_instruction.mx
+++ b/monetdb5/mal/mal_instruction.mx
@@ -1530,10 +1530,15 @@
}
switch (ATOMstorage(type)) {
case TYPE_any:
+ /* In case *DEBUG*_MAL_INSTR is not defined and assertions are disabled,
+ * this will fall-through to the type cases below, rather than
triggering an exception.
+ * Is this correct/intended like this??
+ */
#ifdef DEBUG_MAL_INSTR
throw(SYNTAX, "convertConstant", "missing type");
+#else
+ assert(0);
#endif
- assert(0);
case TYPE_bit:
case TYPE_chr:
case TYPE_sht:
diff --git a/monetdb5/modules/kernel/aggr_bge_count.mx
b/monetdb5/modules/kernel/aggr_bge_count.mx
--- a/monetdb5/modules/kernel/aggr_bge_count.mx
+++ b/monetdb5/modules/kernel/aggr_bge_count.mx
@@ -184,7 +184,6 @@
BATaccessEnd(b,b_use,MMAP_SEQUENTIAL);
if (!(@1 && cnt))
BATaccessEnd(bn,USE_HEAD|USE_HHASH|USE_TAIL,BATtordered(g)&BAThordered(e)&1?MMAP_SEQUENTIAL:MMAP_WILLNEED);
- break;
@h
int
CMDaggrX3_count3(BAT **ret, BAT *b, BAT *g, BAT *e, bit *ignore_nils);
diff --git a/monetdb5/modules/mal/mal_mapi.mx b/monetdb5/modules/mal/mal_mapi.mx
--- a/monetdb5/modules/mal/mal_mapi.mx
+++ b/monetdb5/modules/mal/mal_mapi.mx
@@ -615,7 +615,7 @@
socket_rastream(msgsock, "Server read"),
socket_wastream(msgsock, "Server write"));
} while (1);
- return;
+ /*return;*/ /* never reached as while loop only exits with "goto error"
*/
error:
fprintf(stderr, "!mal_mapi.listen: %s, terminating listener\n", msg);
}
diff --git a/sql/server/rel_schema.c b/sql/server/rel_schema.c
--- a/sql/server/rel_schema.c
+++ b/sql/server/rel_schema.c
@@ -831,7 +831,7 @@
}
return res;
}
- return NULL;
+ /*return NULL;*/ /* never reached as all branches of the above if() end
with return ... */
}
static sql_rel *
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list