Changeset: e5c586271fd7 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e5c586271fd7
Modified Files:
        configure.ag
Branch: Aug2011
Log Message:

fixed X_CFLAGS (--enable-strict) for gcc 4.3.* & gcc 4.4.*:

With gcc 4.3.* & gcc 4.4.4, when using "-Wlogical-op", the compiler complains 
about
"logical '||' with non-zero constant will always evaluate as true" and alike
with, e.g., "(argc == 0 || strchr(av[0], av[0][0]) != NULL)".

Hence, we use such code when testing which warnings options do (not) work,
and thus omit -Wlogical-op for compilers like gcc 4.3 & 4.4 where it does not 
work.


diffs (21 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -512,11 +512,15 @@ AC_DEFUN([MCHECK_ADD_FLAG],
        AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <stdlib.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 
-int main(void) {
+int main(int argc, char **av) {
        char buf[24];
        double d = atof("4.2");
-       snprintf(buf, sizeof(buf), "%f", d);
+       if (argc == 0 || strchr(av[0], av[0][0]) != NULL)
+               snprintf(buf, sizeof(buf), "%f", d);
        return 0;
 }
                                          ]])],
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to