public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [pushed] [gdb/testsuite] Use -std=gnu99 for gdb.server/attach-flag.exp
Date: Mon, 24 Apr 2023 15:03:11 +0200	[thread overview]
Message-ID: <20230424130311.8623-1-tdevries@suse.de> (raw)

When using a compiler defaulting to -std=gnu90, we run into:
...
Running gdb.server/attach-flag.exp ...
gdb compile failed, attach-flag.c: In function 'main':
attach-flag.c:22:3: error: 'for' loop initial declarations are only allowed \
  in C99 or C11 mode
   for (int i = 0; i < NTHREADS; i++)
   ^~~
attach-flag.c:22:3: note: use option -std=c99, -std=gnu99, -std=c11 or \
  -std=gnu11 to compile your code
...

Fix this by using -std=gnu99.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.server/attach-flag.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.server/attach-flag.exp b/gdb/testsuite/gdb.server/attach-flag.exp
index ad67303a7dd..f275b9fc178 100644
--- a/gdb/testsuite/gdb.server/attach-flag.exp
+++ b/gdb/testsuite/gdb.server/attach-flag.exp
@@ -37,7 +37,7 @@ proc run_one_test { non-stop target-non-stop } {
 	}
 
 	if { [prepare_for_testing "failed to prepare" $::testfile $::srcfile \
-		{debug pthreads}] } {
+		{debug pthreads additional_flags=-std=gnu99}] } {
 	    return -1
 	}
     }

base-commit: f20f27e0553b6751c4fa39ce2acb7e0da370ef23
-- 
2.35.3


                 reply	other threads:[~2023-04-24 13:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20230424130311.8623-1-tdevries@suse.de \
    --to=tdevries@suse.de \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).