Adjust GCC --enable-warnings:
Do not enable -pedantic when cross-compiling with a gcc older than 3.0, to avoid warnings from third party system headers.
This commit is contained in:
@@ -742,8 +742,14 @@ AC_DEFUN([CARES_SET_COMPILER_WARNING_OPTS], [
|
|||||||
GNUC)
|
GNUC)
|
||||||
#
|
#
|
||||||
if test "$want_warnings" = "yes"; then
|
if test "$want_warnings" = "yes"; then
|
||||||
|
dnl Do not enable -pedantic when cross-compiling with a gcc older
|
||||||
|
dnl than 3.0, to avoid warnings from third party system headers.
|
||||||
|
if test "x$cross_compiling" != "xyes" ||
|
||||||
|
test "$compiler_num" -ge "300"; then
|
||||||
|
tmp_CFLAGS="$tmp_CFLAGS -pedantic"
|
||||||
|
fi
|
||||||
dnl Set of options we believe *ALL* gcc versions support:
|
dnl Set of options we believe *ALL* gcc versions support:
|
||||||
tmp_CFLAGS="$tmp_CFLAGS -pedantic -Wall -W -Winline -Wnested-externs"
|
tmp_CFLAGS="$tmp_CFLAGS -Wall -W -Winline -Wnested-externs"
|
||||||
tmp_CFLAGS="$tmp_CFLAGS -Wmissing-prototypes -Wpointer-arith"
|
tmp_CFLAGS="$tmp_CFLAGS -Wmissing-prototypes -Wpointer-arith"
|
||||||
tmp_CFLAGS="$tmp_CFLAGS -Wwrite-strings"
|
tmp_CFLAGS="$tmp_CFLAGS -Wwrite-strings"
|
||||||
dnl -Wcast-align is a bit too annoying on all gcc versions ;-)
|
dnl -Wcast-align is a bit too annoying on all gcc versions ;-)
|
||||||
@@ -779,6 +785,12 @@ AC_DEFUN([CARES_SET_COMPILER_WARNING_OPTS], [
|
|||||||
tmp_CFLAGS="$tmp_CFLAGS -Wdeclaration-after-statement"
|
tmp_CFLAGS="$tmp_CFLAGS -Wdeclaration-after-statement"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
#
|
||||||
|
dnl Do not issue warnings for code in system include paths.
|
||||||
|
if test "$compiler_num" -ge "300"; then
|
||||||
|
dnl gcc 3.0 and later
|
||||||
|
tmp_CFLAGS="$tmp_CFLAGS -Wno-system-headers"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
#
|
#
|
||||||
HPUXC)
|
HPUXC)
|
||||||
|
|||||||
@@ -748,8 +748,14 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
|
|||||||
GNUC)
|
GNUC)
|
||||||
#
|
#
|
||||||
if test "$want_warnings" = "yes"; then
|
if test "$want_warnings" = "yes"; then
|
||||||
|
dnl Do not enable -pedantic when cross-compiling with a gcc older
|
||||||
|
dnl than 3.0, to avoid warnings from third party system headers.
|
||||||
|
if test "x$cross_compiling" != "xyes" ||
|
||||||
|
test "$compiler_num" -ge "300"; then
|
||||||
|
tmp_CFLAGS="$tmp_CFLAGS -pedantic"
|
||||||
|
fi
|
||||||
dnl Set of options we believe *ALL* gcc versions support:
|
dnl Set of options we believe *ALL* gcc versions support:
|
||||||
tmp_CFLAGS="$tmp_CFLAGS -pedantic -Wall -W -Winline -Wnested-externs"
|
tmp_CFLAGS="$tmp_CFLAGS -Wall -W -Winline -Wnested-externs"
|
||||||
tmp_CFLAGS="$tmp_CFLAGS -Wmissing-prototypes -Wpointer-arith"
|
tmp_CFLAGS="$tmp_CFLAGS -Wmissing-prototypes -Wpointer-arith"
|
||||||
tmp_CFLAGS="$tmp_CFLAGS -Wwrite-strings"
|
tmp_CFLAGS="$tmp_CFLAGS -Wwrite-strings"
|
||||||
dnl -Wcast-align is a bit too annoying on all gcc versions ;-)
|
dnl -Wcast-align is a bit too annoying on all gcc versions ;-)
|
||||||
@@ -785,6 +791,12 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
|
|||||||
tmp_CFLAGS="$tmp_CFLAGS -Wdeclaration-after-statement"
|
tmp_CFLAGS="$tmp_CFLAGS -Wdeclaration-after-statement"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
#
|
||||||
|
dnl Do not issue warnings for code in system include paths.
|
||||||
|
if test "$compiler_num" -ge "300"; then
|
||||||
|
dnl gcc 3.0 and later
|
||||||
|
tmp_CFLAGS="$tmp_CFLAGS -Wno-system-headers"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
#
|
#
|
||||||
HPUXC)
|
HPUXC)
|
||||||
|
|||||||
Reference in New Issue
Block a user