]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Compile with '-Wpedantic' in devel mode instead of '-pedantic'
authorfxlb <[email protected]>
Tue, 1 Nov 2016 13:28:25 +0000 (14:28 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Tue, 1 Nov 2016 19:33:19 +0000 (20:33 +0100)
Avoid 'Undefined symbol _mcount' with some Solaris compilers.

The '-pedantic' option is unknown to the comiler, but by coincidence
starts with a '-p' (gather performance data). When a file is compiled
with '-p' but is linked without '-p', 'Undefined symbol _mcount' occurs.

aclocal.m4
configure

index 4fa5b80dac48c937ac6e6ebccda7928936d0d32c..ea0f6241c967ae08d994730ae653c1539e2358e9 100644 (file)
@@ -992,7 +992,7 @@ AC_DEFUN(AC_LBL_DEVEL,
                    AC_LBL_CHECK_COMPILER_OPT($1, -Wcast-qual)
                    AC_LBL_CHECK_COMPILER_OPT($1, -Wshadow)
                    AC_LBL_CHECK_COMPILER_OPT($1, -Wdeclaration-after-statement)
                    AC_LBL_CHECK_COMPILER_OPT($1, -Wcast-qual)
                    AC_LBL_CHECK_COMPILER_OPT($1, -Wshadow)
                    AC_LBL_CHECK_COMPILER_OPT($1, -Wdeclaration-after-statement)
-                   AC_LBL_CHECK_COMPILER_OPT($1, -pedantic)
+                   AC_LBL_CHECK_COMPILER_OPT($1, -Wpedantic)
                    AC_LBL_CHECK_COMPILER_OPT($1, -Wold-style-definition)
                    AC_LBL_CHECK_COMPILER_OPT($1, -Wused-but-marked-unused)
                    AC_LBL_CHECK_COMPILER_OPT($1, -W)
                    AC_LBL_CHECK_COMPILER_OPT($1, -Wold-style-definition)
                    AC_LBL_CHECK_COMPILER_OPT($1, -Wused-but-marked-unused)
                    AC_LBL_CHECK_COMPILER_OPT($1, -W)
index af19566ad62f4112d58223be2588c0dc78dd5719..0a0dfdc12d83f346aab2d5f68bf23a8aee273d9c 100755 (executable)
--- a/configure
+++ b/configure
@@ -7574,20 +7574,20 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -pedantic option" >&5
-$as_echo_n "checking whether the compiler supports the -pedantic option... " >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wpedantic option" >&5
+$as_echo_n "checking whether the compiler supports the -Wpedantic option... " >&6; }
        save_CFLAGS="$CFLAGS"
        save_CFLAGS="$CFLAGS"
-       if expr "x-pedantic" : "x-W.*" >/dev/null
+       if expr "x-Wpedantic" : "x-W.*" >/dev/null
        then
        then
-           CFLAGS="$CFLAGS $ac_lbl_unknown_warning_option_error -pedantic"
-       elif expr "x-pedantic" : "x-f.*" >/dev/null
+           CFLAGS="$CFLAGS $ac_lbl_unknown_warning_option_error -Wpedantic"
+       elif expr "x-Wpedantic" : "x-f.*" >/dev/null
        then
        then
-           CFLAGS="$CFLAGS -Werror -pedantic"
-       elif expr "x-pedantic" : "x-m.*" >/dev/null
+           CFLAGS="$CFLAGS -Werror -Wpedantic"
+       elif expr "x-Wpedantic" : "x-m.*" >/dev/null
        then
        then
-           CFLAGS="$CFLAGS -Werror -pedantic"
+           CFLAGS="$CFLAGS -Werror -Wpedantic"
        else
        else
-           CFLAGS="$CFLAGS -pedantic"
+           CFLAGS="$CFLAGS -Wpedantic"
        fi
        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
        fi
        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -7605,7 +7605,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
                CFLAGS="$save_CFLAGS"
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
                CFLAGS="$save_CFLAGS"
-               V_CCOPT="$V_CCOPT -pedantic"
+               V_CCOPT="$V_CCOPT -Wpedantic"
 
 else
 
 
 else