From 8387df1551f18b90b3936c7cbb311416c3db8032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Sat, 4 Feb 2023 17:34:08 +0100 Subject: Annotate functions with access attribute Supported by GCC since version 10. --- configure.ac | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 73a8e91c..015f9046 100644 --- a/configure.ac +++ b/configure.ac @@ -188,6 +188,20 @@ AC_COMPILE_IFELSE([ AC_MSG_RESULT(no)) CFLAGS="$old_CFLAGS" +AC_MSG_CHECKING(for access) +old_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wno-error -Werror=attributes" +AC_COMPILE_IFELSE([ + AC_LANG_SOURCE( + [ + __attribute__((access(read_only, 1, 2))) extern int foo(const char* str, unsigned len); + ],[] + )], + AC_DEFINE([HAVE_ATTR_ACCESS], 1, [The access attribute is supported.]) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no)) +CFLAGS="$old_CFLAGS" + AC_MSG_CHECKING(for NaN support) AC_RUN_IFELSE([ AC_LANG_PROGRAM( -- cgit v1.2.3