aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-11-28 04:21:31 +0000
committerGuy Harris <guy@alum.mit.edu>2002-11-28 04:21:31 +0000
commit4056129fef9c56a34eb8109a2f846b24b542a526 (patch)
tree93de45cc9142027e97f1fd3d50fe0abfe99d0f69
parenta56c79201d66010ecca23bf6f6d57ef4001ec1af (diff)
Add a "--with-extra-gcc-checks" option, which causes "-Wcast-qual
-Wcast-align" to be added to CFLAGS (except in Wiretap, where we already do "-Wcast-qual"). We don't do them by default, as they produce some warnings that aren't easy to eliminate; if we figure out how to eliminate them on all platforms (or at least, on the platforms where you *can't* eliminate them, reduce them to a low level), we can make those options the default. svn path=/trunk/; revision=6689
-rw-r--r--configure.in16
-rw-r--r--epan/configure.in16
-rw-r--r--wiretap/configure.in16
3 files changed, 39 insertions, 9 deletions
diff --git a/configure.in b/configure.in
index 5a14bd86f0..da00ec5cc1 100644
--- a/configure.in
+++ b/configure.in
@@ -1,4 +1,4 @@
-# $Id: configure.in,v 1.187 2002/11/03 17:38:30 oabad Exp $
+# $Id: configure.in,v 1.188 2002/11/28 04:21:28 guy Exp $
dnl
dnl Process this file with autoconf 2.13 or later to produce a
dnl configure script; 2.12 doesn't generate a "configure" script that
@@ -57,13 +57,23 @@ AC_SUBST(HAVE_RPM)
# If we're running gcc, add '-Wall -W' to CFLAGS, and add
# '-D_U_="__attribute__((unused))"' as well, so we can use _U_ to
# flag unused function arguments and not get warnings about them.
+# If "--with-extra-gcc-checks" was specified, add "-Wcast-qual
+# -Wcast-align" as well. (Add more checks here in the future?)
#
# Otherwise, add '-D_U_=""', so that _U_ used to flag an unused function
# argument will compile with non-GCC compilers.
#
-AC_MSG_CHECKING(to see if we can add '-Wall -W' to CFLAGS)
+AC_ARG_WITH(extra-gcc-checks,
+[ --with-extra-gcc-checks do additional -W checks in GCC. [default=no]],
+[
+ if test $withval != no
+ then
+ ethereal_extra_gcc_flags=" -Wcast-qual -Wcast-align"
+ fi
+],)
+AC_MSG_CHECKING(to see if we can add '-Wall -W$ethereal_extra_gcc_flags' to CFLAGS)
if test x$GCC != x ; then
- CFLAGS="-D_U_=\"__attribute__((unused))\" -Wall -W $CFLAGS"
+ CFLAGS="-D_U_=\"__attribute__((unused))\" -Wall -W$ethereal_extra_gcc_flags $CFLAGS"
AC_MSG_RESULT(yes)
else
CFLAGS="-D_U_=\"\" $CFLAGS"
diff --git a/epan/configure.in b/epan/configure.in
index 08b15309a6..6c3acef525 100644
--- a/epan/configure.in
+++ b/epan/configure.in
@@ -1,4 +1,4 @@
-# $Id: configure.in,v 1.31 2002/10/09 22:58:51 jmayer Exp $
+# $Id: configure.in,v 1.32 2002/11/28 04:21:29 guy Exp $
dnl
dnl Process this file with autoconf 2.13 or later to produce a
dnl configure script; 2.12 doesn't generate a "configure" script that
@@ -34,13 +34,23 @@ AC_SUBST(FLEX_PATH)
# If we're running gcc, add '-Wall -W' to CFLAGS, and add
# '-D_U_="__attribute__((unused))"' as well, so we can use _U_ to
# flag unused function arguments and not get warnings about them.
+# If "--with-extra-gcc-checks" was specified, add "-Wcast-qual
+# -Wcast-align" as well. (Add more checks here in the future?)
#
# Otherwise, add '-D_U_=""', so that _U_ used to flag an unused function
# argument will compile with non-GCC compilers.
#
-AC_MSG_CHECKING(to see if we can add '-Wall -W' to CFLAGS)
+AC_ARG_WITH(extra-gcc-checks,
+[ --with-extra-gcc-checks Do additional -W checks in GCC. [default=no]],
+[
+ if test $withval != no
+ then
+ ethereal_extra_gcc_flags=" -Wcast-qual -Wcast-align"
+ fi
+],)
+AC_MSG_CHECKING(to see if we can add '-Wall -W$ethereal_extra_gcc_flags' to CFLAGS)
if test x$GCC != x ; then
- CFLAGS="-D_U_=\"__attribute__((unused))\" -Wall -W $CFLAGS"
+ CFLAGS="-D_U_=\"__attribute__((unused))\" -Wall -W$ethereal_extra_gcc_flags $CFLAGS"
AC_MSG_RESULT(yes)
else
CFLAGS="-D_U_=\"\" $CFLAGS"
diff --git a/wiretap/configure.in b/wiretap/configure.in
index 3fff120c12..4c8c19fbe2 100644
--- a/wiretap/configure.in
+++ b/wiretap/configure.in
@@ -1,4 +1,4 @@
-# $Id: configure.in,v 1.43 2002/11/27 22:24:27 guy Exp $
+# $Id: configure.in,v 1.44 2002/11/28 04:21:31 guy Exp $
dnl
dnl Process this file with autoconf 2.13 or later to produce a
dnl configure script; 2.12 doesn't generate a "configure" script that
@@ -33,13 +33,23 @@ AC_SUBST(FLEX_PATH)
# If we're running gcc, add '-Wall -W -Wcast-qual' to CFLAGS, and add
# '-D_U_="__attribute__((unused))"' as well, so we can use _U_ to
# flag unused function arguments and not get warnings about them.
+# If "--with-extra-gcc-checks" was specified, add "-Wcast-align"
+# as well. (Add more checks here in the future?)
#
# Otherwise, add '-D_U_=""', so that _U_ used to flag an unused function
# argument will compile with non-GCC compilers.
#
-AC_MSG_CHECKING(to see if we can add '-Wall -W' to CFLAGS)
+AC_ARG_WITH(extra-gcc-checks,
+[ --with-extra-gcc-checks Do additional -W checks in GCC. [default=no]],
+[
+ if test $withval != no
+ then
+ ethereal_extra_gcc_flags=" -Wcast-align"
+ fi
+],)
+AC_MSG_CHECKING(to see if we can add '-Wall -W -Wcast-qual$ethereal_extra_gcc_flags' to CFLAGS)
if test x$GCC != x ; then
- CFLAGS="-D_U_=\"__attribute__((unused))\" -Wall -W -Wcast-qual $CFLAGS"
+ CFLAGS="-D_U_=\"__attribute__((unused))\" -Wall -W -Wcast-qual$ethereal_extra_gcc_flags $CFLAGS"
AC_MSG_RESULT(yes)
else
CFLAGS="-D_U_=\"\" $CFLAGS"