Skip to content

Commit 1a5f307

Browse files
committed
Support Clang in ax_gcc_func_attribute.m4
As described in commit 813d942, the embedded GCC macro in `build/ax_gcc_func_attribute.m4` throws false negatives anytime unrelated warnings are raised, setting `have_func_attribute` to no. The fix proposed in the macro upstream changed detecting any warnings to detecting issues related to `-Wattributes` only in order to decide when to set `HAVE_FUNC_ATTRIBUTE_*`. However, the Clang front-end equivalent is `-Wunknown-attribute`. This patch extends ax_gcc_func_attribute.m4 checks to also match the Clang warning.
1 parent f4f3127 commit 1a5f307

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

build/ax_gcc_func_attribute.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [
227227
dnl GCC doesn't exit with an error if an unknown attribute is
228228
dnl provided but only outputs a warning, so accept the attribute
229229
dnl only if no warning were issued.
230-
[AS_IF([grep -- -Wattributes conftest.err],
230+
[AS_IF([grep -- '-W\(unknown-\)\?attributes' conftest.err],
231231
[AS_VAR_SET([ac_var], [no])],
232232
[AS_VAR_SET([ac_var], [yes])])],
233233
[AS_VAR_SET([ac_var], [no])])

0 commit comments

Comments
 (0)