From 405797ed4f6fa1bfb7282e72dfe2c1f4f96e8277 Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@dune-project.org>
Date: Thu, 7 Feb 2013 07:34:26 +0000
Subject: [PATCH] Fix Andreas' previous patch

I shouldn't be doing patch reviews after 2300

Here is Andreas' commit message:

>From 1049843fa0dbc6b340817b0cd69959e742e80d7a Mon Sep 17 00:00:00 2001
From: Andreas Lauser <Andreas.Lauser@iws.uni-stuttgart.de>
Date: Wed, 6 Feb 2013 23:33:28 +0100
Subject: [PATCH] once again: fix dune_unused.m4

my previous attempt was only partially correct: the compiler did not
chocke because the unused attribute was placed behind the variable,
but because the third argument of AC_TRY_COMPILE is placed inside the
main function. it seems like c++ does not support nested functions, so
the test still failed, leading to the equally undesired result that
DUNE_UNUSED did not have an effect anymore. Mea culpa!

(this time I have at least double verified, that the compiler does not
bail out. last time I probably mis-interpreted the wrong lines as the
output of the dune_unused test in config.log.)


[[Imported from SVN: r7106]]
---
 m4/dune_unused.m4 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/m4/dune_unused.m4 b/m4/dune_unused.m4
index db72bf260..1147bc3b2 100644
--- a/m4/dune_unused.m4
+++ b/m4/dune_unused.m4
@@ -3,11 +3,12 @@
 AC_DEFUN([DUNE_CHECKUNUSED],[
     AC_CACHE_CHECK([for __attribute__((unused))], dune_cv_attribute_unused, [
         AC_LANG_PUSH([C++])
-        AC_TRY_COMPILE([#define UNUSED __attribute__((unused))],
-                       [void f(int a UNUSED, int UNUSED)
+        AC_TRY_COMPILE([#define UNUSED __attribute__((unused))
+                        void f(int a UNUSED, int UNUSED)
                         {
                           int UNUSED b;
                         }],
+                       [],
                         dune_cv_attribute_unused="yes",
                         dune_cv_attribute_unused="no")
         AC_LANG_POP([C++])
-- 
GitLab