summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2018-02-27 08:41:25 +1100
committerDarren Tucker <dtucker@dtucker.net>2018-02-27 08:51:56 +1100
commit1323f120d06a26074c4d154fcbe7f49bcad3d741 (patch)
treef54c849c6f1372cda95c5493358cbb87473aa5b6 /configure.ac
parentf0b245b0439e600fab782d19e97980e9f2c2533c (diff)
Check for attributes on prototype args.
Some compilers (gcc 2.9.53, 3.0 and probably others, see gcc bug #3481) do not accept __attribute__ on function pointer prototype args. Check for this and hide them if they're not accepted.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac12
1 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 35e2e8d1d..0ba2ff442 100644
--- a/configure.ac
+++ b/configure.ac
@@ -265,6 +265,18 @@ __attribute__((__unused__)) static void foo(void){return;}]],
265 [compiler does not accept __attribute__ on return types]) ] 265 [compiler does not accept __attribute__ on return types]) ]
266) 266)
267 267
268AC_MSG_CHECKING([if compiler allows __attribute__ prototype args])
269AC_COMPILE_IFELSE(
270 [AC_LANG_PROGRAM([[
271#include <stdlib.h>
272typedef void foo(const char *, ...) __attribute__((format(printf, 1, 2)));]],
273 [[ exit(0); ]])],
274 [ AC_MSG_RESULT([yes]) ],
275 [ AC_MSG_RESULT([no])
276 AC_DEFINE(NO_ATTRIBUTE_ON_PROTOTYPE_ARGS, 1,
277 [compiler does not accept __attribute__ on protoype args]) ]
278)
279
268if test "x$no_attrib_nonnull" != "x1" ; then 280if test "x$no_attrib_nonnull" != "x1" ; then
269 AC_DEFINE([HAVE_ATTRIBUTE__NONNULL__], [1], [Have attribute nonnull]) 281 AC_DEFINE([HAVE_ATTRIBUTE__NONNULL__], [1], [Have attribute nonnull])
270fi 282fi