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

Fix buggy use of AC_TRY_COMPILE

Thanks to Andreas Lauser for this patch.

Here is his own commit message:

From: Andreas Lauser <and@poware.org>
Date: Mon, 4 Feb 2013 15:34:22 +0100
Subject: [PATCH] fix the test for __attribute__((unused))

it contained two errors which "anihilated" themselfs: the first was a
syntax error in the test itself (the UNUSED macro must be placed
before the identifier of the variable), which caused the compiler to
always return an error. this was compensated by an incorrect
invocation of the AC_TRY_COMPILE macro which featured an empty
argument as third argument instead of the action to be executed if the
test succeeded. this in turn always lead the forth argument (which was
intended by the test to be executed if the test succeeds but was
actually executed if it failed) to be always triggered. In turn this
leads me to the conclusion that DUNE was never compiled using a
compiler which does not support __attribute__((unused)) since this
macro was introduced...


[[Imported from SVN: r7105]]
parent fd613e1a
No related branches found
No related tags found
No related merge requests found
......@@ -6,9 +6,8 @@ AC_DEFUN([DUNE_CHECKUNUSED],[
AC_TRY_COMPILE([#define UNUSED __attribute__((unused))],
[void f(int a UNUSED, int UNUSED)
{
int b 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