From: Guy Harris Date: Sat, 15 Sep 2018 20:12:49 +0000 (-0700) Subject: Don't warn about declarations after statements. X-Git-Tag: tcpdump-4.99-bp~1008 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/b6e38e7c52883d89559044bfe8047c32f466fb47 Don't warn about declarations after statements. We now allow them, and require a compiler that supports them, so there's no need to warn about them. --- diff --git a/configure b/configure index 990363f2..19259b41 100755 --- a/configure +++ b/configure @@ -675,7 +675,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -756,7 +755,6 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1009,15 +1007,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1155,7 +1144,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1308,7 +1297,6 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -2425,6 +2413,10 @@ fi export CC fi +# +# Try to enable as many C99 features as we can. +# At minimum, we want C++/C99-style // comments. +# ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3391,6 +3383,10 @@ if test "x$ac_cv_prog_cc_c99" != xno; then : fi +if test "$ac_cv_prog_cc_c99" = "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The C compiler does not support C99; there may be compiler errors" >&5 +$as_echo "$as_me: WARNING: The C compiler does not support C99; there may be compiler errors" >&2;} +fi diff --git a/configure.ac b/configure.ac index 0202f039..2439aaa7 100644 --- a/configure.ac +++ b/configure.ac @@ -20,7 +20,14 @@ AC_CONFIG_SRCDIR(tcpdump.c) AC_CANONICAL_HOST AC_LBL_C_INIT_BEFORE_CC(V_INCLS) +# +# Try to enable as many C99 features as we can. +# At minimum, we want C++/C99-style // comments. +# AC_PROG_CC_C99 +if test "$ac_cv_prog_cc_c99" = "no"; then + AC_MSG_WARN([The C compiler does not support C99; there may be compiler errors]) +fi AC_LBL_C_INIT(V_CCOPT, V_INCLS) AC_LBL_C_INLINE