From addcefdab2217e968a81bdd3714288ed71be4437 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Tue, 27 Jan 2009 12:56:32 +0000 Subject: [PATCH] Stopped GCC warning about unused variables We detect real unused variables from the occam program ourselves, but we don't want GCC warnings for all the unused _sizes variables and so on --- configure.ac | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 8e8dca4..7975e8b 100644 --- a/configure.ac +++ b/configure.ac @@ -147,6 +147,16 @@ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[ ]]), no_tree_vrp= ) +#Check whether GCC accepts the -Wno-unused-parameter -Wno-unused-variable flags: +AC_MSG_CHECKING([whether -Wno-unused-parameter and -Wno-unused-variable flags are accepted]) +CFLAGS="-Wno-unused-parameter -Wno-unused-variable" +AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[ ]]), + AC_MSG_RESULT([yes]) + no_unused="-Wno-unused-parameter -Wno-unused-variable" + , + AC_MSG_RESULT([no]) + no_unused= +) CFLAGS="$old_CFLAGS" @@ -226,7 +236,7 @@ CFLAGS="$CFLAGS $no_strict_overflow $no_tree_vrp" # that, but I'm also leaving these flags in so that any other code (for example, # that Tock might spit out) that uses increments doesn't have the same issue. -common_cflags="-Wall -ggdb3 -Isupport $no_strict_aliasing" +common_cflags="-Wall $no_unused -ggdb3 -Isupport $no_strict_aliasing" TOCK_CFLAGS="$gnu89_inline $CPPFLAGS $CFLAGS $common_cflags $CCSP_CFLAGS $GLIB_CFLAGS" TOCK_CLDFLAGS="$LDFLAGS $CCSP_LIBS $GLIB_LIBS"