]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb, testsuite: Adapt gdb.base/callfuncs.exp for new clang warning.
authorFelix Willgerodt <felix.willgerodt@intel.com>
Fri, 3 Jun 2022 12:26:41 +0000 (14:26 +0200)
committerFelix Willgerodt <felix.willgerodt@intel.com>
Fri, 19 Aug 2022 09:24:00 +0000 (11:24 +0200)
Clang 15.0.0 enabled the warning for deprecated non-prototype functions
by default: https://reviews.llvm.org/D122895
Callfuncs.exp is impacted and won't run due to new warnings:

callfuncs.c:339:5: warning: a function declaration without a prototype is
deprecated in all versions of C and is not supported in C2x
[-Wdeprecated-non-prototype]
int t_float_values (float_arg1, float_arg2)

This patch disables those warnings with -Wno-deprecated-non-prototype.
Removing the test for deprecated syntax would also be an option. But I will
leave that up for others to decide/implement.

gdb/testsuite/gdb.base/callfuncs.exp

index 4448cc127ba1ab90b9f615f65fc95903c5b53081..44289eebc8b5d49cd11136e2da1ce8ec8cda9adb 100644 (file)
@@ -18,7 +18,9 @@
 
 standard_testfile
 
-set compile_flags {debug}
+# We still want to test non-prototype functions for now, which is why
+# we disable compilers warning about them.
+set compile_flags {debug additional_flags=-Wno-deprecated-non-prototype}
 if [support_complex_tests] {
     lappend compile_flags "additional_flags=-DTEST_COMPLEX"
 }