Skip to content
Snippets Groups Projects
Commit 405797ed authored by Oliver Sander's avatar Oliver Sander
Browse files

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]]
parent a1f81535
No related branches found
No related tags found
No related merge requests found
......@@ -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++])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment