From 8b6e6bf04f6f62a576ae818758d6d5a58ca69a5d Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin (Intel)" Date: Fri, 16 Aug 2019 00:08:27 -0700 Subject: config.h: separate function and function pointer attributes; automate Separate out function and function pointer attributes, as not all versions of all compilers support both. Have macros related to function attributes auto-generated by autoheader. As a result, rename config.h.in to unconfig.h, to make it more obvious that it is really intended to be included from some C programs. Signed-off-by: H. Peter Anvin (Intel) --- configure.ac | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 35116b7c..9f3f9d5f 100644 --- a/configure.ac +++ b/configure.ac @@ -1,8 +1,8 @@ dnl Process this file with autoconf 2.69 or later to produce dnl a configure script. AC_PREREQ(2.69) -AC_INIT(config/config.h.in) -AC_CONFIG_HEADERS(config/config.h) +AC_INIT([config/undef.h]) +AC_CONFIG_HEADERS([config/config.h:config/unconfig.h]) AC_PREFIX_PROGRAM(nasm) AC_CONFIG_AUX_DIR(autoconf/helpers) @@ -225,14 +225,15 @@ dnl some other features of gcc. dnl PA_ADD_CFLAGS([-Werror=attributes]) PA_FUNC_ATTRIBUTE(noreturn) -PA_FUNC_ATTRIBUTE(returns_nonnull) +PA_FUNC_ATTRIBUTE(returns_nonnull,,,,,never_null) PA_FUNC_ATTRIBUTE(malloc) -PA_FUNC_ATTRIBUTE(alloc_size, (1)) -PA_FUNC_ATTRIBUTE(sentinel,,, [const char *, ...], ["a","b",NULL]) -PA_FUNC_ATTRIBUTE(format, [(printf,1,2)], int, [const char *, ...], ["%d",1]) +PA_FUNC_ATTRIBUTE(alloc_size,[1]) +PA_FUNC_ATTRIBUTE(alloc_size,[1,2]) +PA_FUNC_ATTRIBUTE(sentinel,,, [const char *, ...], ["a","b",NULL],end_with_null) +PA_FUNC_ATTRIBUTE(format, [printf,1,2], int, [const char *, ...], ["%d",1]) PA_FUNC_ATTRIBUTE(const) PA_FUNC_ATTRIBUTE(pure) -PA_FUNC_ATTRIBUTE(cold) +PA_FUNC_ATTRIBUTE(cold,,,,,unlikely_func) PA_FUNC_ATTRIBUTE_ERROR dnl -- cgit v1.2.1