]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb.base/nodebug.exp: Disable -Wdeprecated-non-prototype
authorPedro Alves <pedro@palves.net>
Mon, 13 Jul 2026 23:49:52 +0000 (00:49 +0100)
committerPedro Alves <pedro@palves.net>
Wed, 22 Jul 2026 12:29:52 +0000 (13:29 +0100)
Testing gdb.base/nodebug.exp with Clang shows:

 .../gdb.base/nodebug.c:63:1: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C23 [-Wdeprecated-non-prototype]
    63 | multf_noproto (v1, v2)
       | ^

Fix it by making gdb.base/nodebug.exp disable -Wdeprecated-non-prototype.

Tested with Clang 18.1.3 on x86_64-pc-linux-gnu, and Clang 21.0.0git
on x86_64-pc-windows-msvc.

Approved-By: Tom Tromey <tom@tromey.com>
Change-Id: Id207053331377abec6918aa1188180d609c74273

gdb/testsuite/gdb.base/nodebug.exp

index e4138a801da0cba5524533bd811679494576b1e0..9cdff5d5560018e72219075f9ec4a8e7f48ed9a9 100644 (file)
@@ -25,6 +25,15 @@ if {[have_compile_flag -std=c99]} {
     lappend exec_opts additional_flags=-std=c99
 }
 
+if {[test_compiler_info "clang-*"]} {
+    # Even with -std=c99, Clang warns like so:
+    #
+    #  warning: a function definition without a prototype is deprecated
+    #  in all versions of C and is not supported in C23
+    #  [-Wdeprecated-non-prototype]
+    lappend exec_opts additional_flags=-Wno-deprecated-non-prototype
+}
+
 if {[test_compiler_info "xlc-*"]} {
     # By default, IBM's xlc compiler doesn't add static variables into the symtab.
     # Use "-qstatsym" to do so.