diff options
author | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2013-01-04 02:12:51 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2013-01-04 02:12:51 +0000 |
commit | 3be49bedd126c4a4446d6f05fafe653fa2578b03 (patch) | |
tree | 22502b2c5c29ef9b000979ad6a6759d0bbf35204 /configure.ac | |
parent | 6ea36c51c3b912d139833f033bd5d23649e9aea3 (diff) |
In AC_WIRESHARK_GCC_CFLAGS_CHECK() don't check if $3 (the program to be run)
exists by doing:
if test "x$3" != "x" ; then
because if the program contains quotes it breaks the shell's parsing.
Instead test for the existence of $4 (which is mandatory if $3 is given).
Fix up the test program for -Wlogical-op so that it actually compiles
warning-free (at least on my system) when the compiler doesn't have the bug
we're checking for.
svn path=/trunk/; revision=46926
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index c0d7b2ccae..7fc7a32a56 100644 --- a/configure.ac +++ b/configure.ac @@ -471,16 +471,17 @@ foo(int a) [warns about variables in function declarations shadowing other variables]) # Unfortunately some versions of gcc generate logical-op warnings when strchr() -# is given a constant seperators list. +# is given a constant string. # gcc versions 4.3.2 and 4.4.5 are known to have the problem. AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wlogical-op, C, [ #include <string.h> -extern int foo(char *, int); +int foo(const char *, int); +int bar(void); int -foo(char *sep, int c) +foo(const char *sep, int c) { if (strchr (sep, c) != NULL) return 1; @@ -489,9 +490,9 @@ foo(char *sep, int c) } int -main(int argc, char **argv) +bar(void) { - return foo(\"<\", 'a'); + return foo("<", 'a'); } ], [generates warnings from strchr()]) |