summaryrefslogtreecommitdiff
path: root/m4/ax_gcc_func_attribute.m4
diff options
context:
space:
mode:
authorReini Urban <rurban@cpan.org>2019-10-23 16:12:46 +0200
committerReini Urban <rurban@cpan.org>2019-10-23 16:15:29 +0200
commitf0cef5ff5bf9ba5f0b2a25f87322c7cebac43849 (patch)
tree1ed5ef870ee359ab5576db9594ab7a9f78893218 /m4/ax_gcc_func_attribute.m4
parent62e8491dbc174113a04fe910cad1e92e8a9e2164 (diff)
downloadautoconf-archive-f0cef5ff5bf9ba5f0b2a25f87322c7cebac43849.tar.gz
add AX_GCC_FUNC_ATTRIBUTE(gnu_format)
newer gcc warns about function might be a candidate for gnu_printf format attribute [-Wsuggest-attribute=format] Usage: AX_GCC_FUNC_ATTRIBUTE(gnu_format) and: #ifdef HAVE_FUNC_ATTRIBUTE_GNU_FORMAT __attribute__ ((format (gnu_printf, 1, 2))) #elif HAVE_FUNC_ATTRIBUTE_FORMAT __attribute__ ((format (printf, 1, 2))) #endif
Diffstat (limited to 'm4/ax_gcc_func_attribute.m4')
-rw-r--r--m4/ax_gcc_func_attribute.m46
1 files changed, 5 insertions, 1 deletions
diff --git a/m4/ax_gcc_func_attribute.m4 b/m4/ax_gcc_func_attribute.m4
index 098c9aa..c926439 100644
--- a/m4/ax_gcc_func_attribute.m4
+++ b/m4/ax_gcc_func_attribute.m4
@@ -42,6 +42,7 @@
# flatten
# format
# format_arg
+# gnu_format
# gnu_inline
# hot
# ifunc
@@ -77,7 +78,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 9
+#serial 10
AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [
AS_VAR_PUSHDEF([ac_var], [ax_cv_have_func_attribute_$1])
@@ -140,6 +141,9 @@ AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [
[format], [
int foo(const char *p, ...) __attribute__(($1(printf, 1, 2)));
],
+ [gnu_format], [
+ int foo(const char *p, ...) __attribute__((format(gnu_printf, 1, 2)));
+ ],
[format_arg], [
char *foo(const char *p) __attribute__(($1(1)));
],