From d5871ffb64d0c7bee96ad9d5c5462df5e7c48fee Mon Sep 17 00:00:00 2001
From: "Yury V. Zaytsev" <yury@shurup.com>
Date: Thu, 30 May 2024 19:26:07 +0200
Subject: [PATCH] buildsys: update ax_gcc_func_attribute to fix fallthrough
detection
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
---
m4.include/ax_gcc_func_attribute.m4 | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/m4.include/ax_gcc_func_attribute.m4 b/m4.include/ax_gcc_func_attribute.m4
index 098c9aadf..fa4e089d6 100644
a
|
b
|
|
42 | 42 | # flatten |
43 | 43 | # format |
44 | 44 | # format_arg |
| 45 | # gnu_format |
45 | 46 | # gnu_inline |
46 | 47 | # hot |
47 | 48 | # ifunc |
… |
… |
|
77 | 78 | # and this notice are preserved. This file is offered as-is, without any |
78 | 79 | # warranty. |
79 | 80 | |
80 | | #serial 9 |
| 81 | #serial 13 |
81 | 82 | |
82 | 83 | AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [ |
83 | 84 | AS_VAR_PUSHDEF([ac_var], [ax_cv_have_func_attribute_$1]) |
… |
… |
AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [ |
132 | 133 | int foo( void ) __attribute__(($1)); |
133 | 134 | ], |
134 | 135 | [fallthrough], [ |
135 | | int foo( void ) {switch (0) { case 1: __attribute__(($1)); case 2: break ; }}; |
| 136 | void foo( int x ) {switch (x) { case 1: __attribute__(($1)); case 2: break ; }}; |
136 | 137 | ], |
137 | 138 | [flatten], [ |
138 | 139 | int foo( void ) __attribute__(($1)); |
… |
… |
AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [ |
140 | 141 | [format], [ |
141 | 142 | int foo(const char *p, ...) __attribute__(($1(printf, 1, 2))); |
142 | 143 | ], |
| 144 | [gnu_format], [ |
| 145 | int foo(const char *p, ...) __attribute__((format(gnu_printf, 1, 2))); |
| 146 | ], |
143 | 147 | [format_arg], [ |
144 | 148 | char *foo(const char *p) __attribute__(($1(1))); |
145 | 149 | ], |
… |
… |
AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [ |
224 | 228 | dnl GCC doesn't exit with an error if an unknown attribute is |
225 | 229 | dnl provided but only outputs a warning, so accept the attribute |
226 | 230 | dnl only if no warning were issued. |
227 | | [AS_IF([test -s conftest.err], |
| 231 | [AS_IF([grep -- -Wattributes conftest.err], |
228 | 232 | [AS_VAR_SET([ac_var], [no])], |
229 | 233 | [AS_VAR_SET([ac_var], [yes])])], |
230 | 234 | [AS_VAR_SET([ac_var], [no])]) |