From f8538abbd590cbc70de5d8d4177acd63a7f26a80 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Sun, 17 Mar 2013 15:36:42 +0000 Subject: Explicitly test for -Wno-unused-but-set-variable compiler option (bzr r12219) --- configure.ac | 12 +++++++++++- src/libgdl/Makefile_insert | 4 +++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index cc2c19e8a..31c06fead 100644 --- a/configure.ac +++ b/configure.ac @@ -112,8 +112,18 @@ if test "$GCC" = "yes"; then CFLAGS="$ink_svd_CFLAGS" fi - AM_CONDITIONAL(CC_W_NO_SUPPORTED, test "$ink_opt_ok" = "yes") + # This Automake variable is only used to suppress warnings in our internal + # fork of GDL. Once we get rid of our GDL fork, we can delete this test + AC_MSG_CHECKING([compiler support for -Wno-unused-but-set-variable]) + ink_svd_CFLAGS="$CFLAGS" + CFLAGS="-Wno-unused-but-set-variable $CFLAGS" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [ink_opt_ok=yes], [ink_opt_ok=no]) + AC_MSG_RESULT([$ink_opt_ok]) + CFLAGS="$ink_svd_CFLAGS" + AM_CONDITIONAL(CC_WNO_UNUSED_BUT_SET_VARIABLE_SUPPORTED, test "$ink_opt_ok" = "yes") + + #### # Linker flags... diff --git a/src/libgdl/Makefile_insert b/src/libgdl/Makefile_insert index e92223f0b..6669a28fa 100644 --- a/src/libgdl/Makefile_insert +++ b/src/libgdl/Makefile_insert @@ -44,12 +44,14 @@ libgdl/all: libgdl/libgdl.a libgdl/clean: rm -f libgdl/libgdl.a $(libgdl_gdl_a_OBJECTS) -if CC_W_NO_SUPPORTED # Suppress some non-critical warnings for libgdl. We will drop our forked copy # of GDL once we upgrade to Gtk+ 3 so it's more important to minimise the number # of changes we make to GDL than to fix these minor issues in trunk. +if CC_WNO_UNUSED_BUT_SET_VARIABLE_SUPPORTED libgdl_libgdl_a_CFLAGS = -Wno-unused-parameter -Wno-sign-compare -Wno-unused-variable -Wno-unused-but-set-variable $(AM_CFLAGS) +else +libgdl_libgdl_a_CFLAGS = -Wno-unused-parameter -Wno-sign-compare -Wno-unused-variable $(AM_CFLAGS) endif libgdl_libgdl_a_SOURCES = \ -- cgit v1.2.3