From 01f1430e8b98a61f3d5e62c7561377c7ec99d201 Mon Sep 17 00:00:00 2001 From: Michal Ludvig Date: Wed, 4 Nov 2009 23:42:16 +0000 Subject: [PATCH] * configure.ac, Makefile.am: Test if GCC accepts -Wno-pointer-sign git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@878 81a1dc3b-b13d-400b-aceb-764788c761c2 --- ChangeLog | 4 ++++ Makefile.am | 2 +- configure.ac | 19 +++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 761d01d9..ec87efad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-11-04 Michal Ludvig + + * configure.ac, Makefile.am: Test if GCC accepts -Wno-pointer-sign + 2009-11-04 Michal Ludvig * buspirate.c: Implemented 'BinMode' support for diff --git a/Makefile.am b/Makefile.am index e51a4c8d..9a68852d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -51,7 +51,7 @@ libavrdude_a_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\" avrdude_CFLAGS = @ENABLE_WARNINGS@ -libavrdude_a_CFLAGS = @ENABLE_WARNINGS@ -Wno-sign-compare -Wno-sign-conversion -Wno-pointer-sign +libavrdude_a_CFLAGS = @ENABLE_WARNINGS@ avrdude_LDADD = $(top_builddir)/$(noinst_LIBRARIES) @LIBUSB@ @LIBHID@ -lm diff --git a/configure.ac b/configure.ac index d082c95d..6e80342d 100644 --- a/configure.ac +++ b/configure.ac @@ -254,6 +254,25 @@ AC_SUBST(WINDOWS_DIRS,$WINDOWS_DIRS) # If we are compiling with gcc, enable all warning and make warnings errors. if test "$GCC" = yes; then ENABLE_WARNINGS="-Wall" + + # does this compiler support -Wno-pointer-sign ? + AC_MSG_CHECKING([if gcc accepts -Wno-pointer-sign ]) + + safe_CFLAGS=$CFLAGS + CFLAGS="$ENABLE_WARNINGS -Wno-pointer-sign" + + AC_TRY_COMPILE(, [ int main () { return 0 ; } ], [ + no_pointer_sign=yes + AC_MSG_RESULT([yes]) + ], [ + no_pointer_sign=no + AC_MSG_RESULT([no]) + ]) + CFLAGS=$safe_CFLAGS + + if test x$no_pointer_sign = xyes; then + ENABLE_WARNINGS="$ENABLE_WARNINGS -Wno-pointer-sign" + fi fi AC_SUBST(ENABLE_WARNINGS,$ENABLE_WARNINGS)