Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: gdb-patches@sourceware.org
Subject: [PATCH] gdb.base/nodebug.exp: Disable -Wdeprecated-non-prototype
Date: Fri, 17 Jul 2026 16:14:36 +0100	[thread overview]
Message-ID: <20260717151436.2178151-1-pedro@palves.net> (raw)

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.

Change-Id: Id207053331377abec6918aa1188180d609c74273
---
 gdb/testsuite/gdb.base/nodebug.exp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gdb/testsuite/gdb.base/nodebug.exp b/gdb/testsuite/gdb.base/nodebug.exp
index e4138a801da..9cdff5d5560 100644
--- a/gdb/testsuite/gdb.base/nodebug.exp
+++ b/gdb/testsuite/gdb.base/nodebug.exp
@@ -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.

base-commit: 490469846dcef89fe53668bdbba73591c64bed61
-- 
2.54.0


             reply	other threads:[~2026-07-17 15:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-17 15:14 Pedro Alves [this message]
2026-07-21 17:44 ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260717151436.2178151-1-pedro@palves.net \
    --to=pedro@palves.net \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox