mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
Perhaps -Wundef is better on gcc versions after 2.95, since the autobuild
on FreeBSD gives us lots of warnings in system headers and I suspect this option is what causes them!
This commit is contained in:
parent
193a652e6a
commit
6789dfc5f5
37
acinclude.m4
37
acinclude.m4
@ -518,32 +518,41 @@ AC_DEFUN([CURL_CC_DEBUG_OPTS],
|
|||||||
WARN="-Wall $WARN"
|
WARN="-Wall $WARN"
|
||||||
fi
|
fi
|
||||||
else dnl $ICC = yes
|
else dnl $ICC = yes
|
||||||
dnl
|
dnl this is a set of options we believe *ALL* gcc versions support:
|
||||||
WARN="-W -Wall -Wwrite-strings -pedantic -Wno-long-long -Wundef -Wpointer-arith -Wnested-externs -Winline -Wmissing-declarations -Wmissing-prototypes -Wsign-compare"
|
WARN="-W -Wall -Wwrite-strings -pedantic -Wno-long-long -Wpointer-arith -Wnested-externs -Winline -Wmissing-declarations -Wmissing-prototypes -Wsign-compare"
|
||||||
|
|
||||||
dnl -Wcast-align is a bit too annoying ;-)
|
dnl -Wcast-align is a bit too annoying on all gcc versions ;-)
|
||||||
|
|
||||||
|
if test "$gccnum" -gt "295"; then
|
||||||
|
dnl only if the compiler is newer than 2.95 since we got lots of
|
||||||
|
dnl "`_POSIX_C_SOURCE' is not defined" in system headers with
|
||||||
|
dnl gcc 2.95.4 on FreeBSD 4.9!
|
||||||
|
WARN="$WARN -Wundef"
|
||||||
|
fi
|
||||||
|
|
||||||
if test "$gccnum" -ge "296"; then
|
if test "$gccnum" -ge "296"; then
|
||||||
dnl gcc 2.96 or later
|
dnl gcc 2.96 or later
|
||||||
WARN="$WARN -Wfloat-equal"
|
WARN="$WARN -Wfloat-equal"
|
||||||
|
fi
|
||||||
|
|
||||||
if test "$gccnum" -gt "296"; then
|
if test "$gccnum" -gt "296"; then
|
||||||
dnl this option does not exist in 2.96
|
dnl this option does not exist in 2.96
|
||||||
WARN="$WARN -Wno-format-nonliteral"
|
WARN="$WARN -Wno-format-nonliteral"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl -Wunreachable-code seems totally unreliable on my gcc 3.3.2 on
|
dnl -Wunreachable-code seems totally unreliable on my gcc 3.3.2 on
|
||||||
dnl on i686-Linux as it gives us heaps with false positives
|
dnl on i686-Linux as it gives us heaps with false positives
|
||||||
if test "$gccnum" -ge "303"; then
|
if test "$gccnum" -ge "303"; then
|
||||||
dnl gcc 3.3 and later
|
dnl gcc 3.3 and later
|
||||||
WARN="$WARN -Wendif-labels -Wstrict-prototypes"
|
WARN="$WARN -Wendif-labels -Wstrict-prototypes"
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for flag in $CPPFLAGS; do
|
for flag in $CPPFLAGS; do
|
||||||
case "$flag" in
|
case "$flag" in
|
||||||
-I*)
|
-I*)
|
||||||
dnl include path
|
dnl Include path, provide a -isystem option for the same dir
|
||||||
|
dnl to prevent warnings in those dirs. The -isystem was not very
|
||||||
|
dnl reliable on earlier gcc versions.
|
||||||
add=`echo $flag | sed 's/^-I/-isystem /g'`
|
add=`echo $flag | sed 's/^-I/-isystem /g'`
|
||||||
WARN="$WARN $add"
|
WARN="$WARN $add"
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user