aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss.ws@gmail.com>2013-01-03 16:50:54 +0000
committerJeff Morriss <jeff.morriss.ws@gmail.com>2013-01-03 16:50:54 +0000
commit69d42810f61e69ee9a6d85fae0eab98843abed83 (patch)
tree5c130d798ca7e46f9e4e80cc0509322ab9e29342 /configure.ac
parent936626b160c33019c0808a5d96e1d916fabe3e26 (diff)
downloadwireshark-69d42810f61e69ee9a6d85fae0eab98843abed83.tar.gz
wireshark-69d42810f61e69ee9a6d85fae0eab98843abed83.tar.bz2
wireshark-69d42810f61e69ee9a6d85fae0eab98843abed83.zip
Don't use -Wlogical-op if it causes gcc to generate warnings about logical
operations always evaluating to the same value in (the expansion of) strchr(). See: https://www.wireshark.org/lists/wireshark-dev/201212/msg00136.html svn path=/trunk/; revision=46916
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac26
1 files changed, 25 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 33c8eca434..93aa3e1720 100644
--- a/configure.ac
+++ b/configure.ac
@@ -442,7 +442,6 @@ AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wattributes)
AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wdiv-by-zero)
AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wignored-qualifiers)
AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wpragmas)
-AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wlogical-op)
AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wno-overlength-strings)
AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wwrite-strings)
AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wno-long-long)
@@ -471,6 +470,31 @@ 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.
+# 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>
+
+int
+foo(char *sep, int c)
+{
+ if (strchr (sep, c) != NULL)
+ return 1;
+ else
+ return 0;
+}
+
+int
+main(int argc, char **argv)
+{
+ return foo(\"<\", 'a');
+}
+ ],
+ [generates warnings from strchr()])
+
+
## AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wno-error=unused-but-set-variable)
#