Adjust GCC warnings:
Disable following warnings when cross-compiling with a gcc older
than 3.0, to avoid warnings from third party system headers:
-Wmissing-prototypes
-Wunused
-Wshadow
This commit is contained in:
@@ -750,9 +750,14 @@ AC_DEFUN([CARES_SET_COMPILER_WARNING_OPTS], [
|
|||||||
fi
|
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 -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 -Wpointer-arith -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 ;-)
|
||||||
|
dnl Do not enable some warnings, when cross-compiling with a gcc
|
||||||
|
dnl older than 3.0, triggered on third party system headers.
|
||||||
|
if test "x$cross_compiling" != "xyes" ||
|
||||||
|
test "$compiler_num" -ge "300"; then
|
||||||
|
tmp_CFLAGS="$tmp_CFLAGS -Wmissing-prototypes"
|
||||||
|
fi
|
||||||
if test "$compiler_num" -ge "207"; then
|
if test "$compiler_num" -ge "207"; then
|
||||||
dnl gcc 2.7 or later
|
dnl gcc 2.7 or later
|
||||||
tmp_CFLAGS="$tmp_CFLAGS -Wmissing-declarations"
|
tmp_CFLAGS="$tmp_CFLAGS -Wmissing-declarations"
|
||||||
@@ -790,6 +795,13 @@ AC_DEFUN([CARES_SET_COMPILER_WARNING_OPTS], [
|
|||||||
if test "$compiler_num" -ge "300"; then
|
if test "$compiler_num" -ge "300"; then
|
||||||
dnl gcc 3.0 and later
|
dnl gcc 3.0 and later
|
||||||
tmp_CFLAGS="$tmp_CFLAGS -Wno-system-headers"
|
tmp_CFLAGS="$tmp_CFLAGS -Wno-system-headers"
|
||||||
|
else
|
||||||
|
dnl Disable some warnings, when cross-compiling with a gcc
|
||||||
|
dnl older than 3.0, triggered on third party system headers.
|
||||||
|
if test "x$cross_compiling" = "xyes"; then
|
||||||
|
tmp_CFLAGS="$tmp_CFLAGS -Wno-missing-prototypes"
|
||||||
|
tmp_CFLAGS="$tmp_CFLAGS -Wno-unused -Wno-shadow"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -756,9 +756,14 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
|
|||||||
fi
|
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 -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 -Wpointer-arith -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 ;-)
|
||||||
|
dnl Do not enable some warnings, when cross-compiling with a gcc
|
||||||
|
dnl older than 3.0, triggered on third party system headers.
|
||||||
|
if test "x$cross_compiling" != "xyes" ||
|
||||||
|
test "$compiler_num" -ge "300"; then
|
||||||
|
tmp_CFLAGS="$tmp_CFLAGS -Wmissing-prototypes"
|
||||||
|
fi
|
||||||
if test "$compiler_num" -ge "207"; then
|
if test "$compiler_num" -ge "207"; then
|
||||||
dnl gcc 2.7 or later
|
dnl gcc 2.7 or later
|
||||||
tmp_CFLAGS="$tmp_CFLAGS -Wmissing-declarations"
|
tmp_CFLAGS="$tmp_CFLAGS -Wmissing-declarations"
|
||||||
@@ -796,6 +801,13 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
|
|||||||
if test "$compiler_num" -ge "300"; then
|
if test "$compiler_num" -ge "300"; then
|
||||||
dnl gcc 3.0 and later
|
dnl gcc 3.0 and later
|
||||||
tmp_CFLAGS="$tmp_CFLAGS -Wno-system-headers"
|
tmp_CFLAGS="$tmp_CFLAGS -Wno-system-headers"
|
||||||
|
else
|
||||||
|
dnl Disable some warnings, when cross-compiling with a gcc
|
||||||
|
dnl older than 3.0, triggered on third party system headers.
|
||||||
|
if test "x$cross_compiling" = "xyes"; then
|
||||||
|
tmp_CFLAGS="$tmp_CFLAGS -Wno-missing-prototypes"
|
||||||
|
tmp_CFLAGS="$tmp_CFLAGS -Wno-unused -Wno-shadow"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
#
|
#
|
||||||
|
|||||||
Reference in New Issue
Block a user