Merge tag 'docs-5.18-2' of git://git.lwn.net/linux
[linux-2.6-microblaze.git] / scripts / test_fortify.sh
index a4da365..c2688ab 100644 (file)
@@ -46,8 +46,12 @@ if "$@" -Werror -c "$IN" -o "$OUT".o 2> "$TMP" ; then
                status="warning: unsafe ${FUNC}() usage lacked '$WANT' symbol in $IN"
        fi
 else
-       # If the build failed, check for the warning in the stderr (gcc).
-       if ! grep -q -m1 "error: call to .\b${WANT}\b." "$TMP" ; then
+       # If the build failed, check for the warning in the stderr.
+       # GCC:
+       # ./include/linux/fortify-string.h:316:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning]
+       # Clang 14:
+       # ./include/linux/fortify-string.h:316:4: error: call to __write_overflow_field declared with 'warning' attribute: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror,-Wattribute-warning]
+       if ! grep -Eq -m1 "error: call to .?\b${WANT}\b.?" "$TMP" ; then
                status="warning: unsafe ${FUNC}() usage lacked '$WANT' warning in $IN"
        fi
 fi