From: Tom de Vries <tdevries@suse.de>
To: Lancelot SIX <lancelot.six@amd.com>, gdb-patches@sourceware.org
Cc: aburgess@redhat.com
Subject: Re: [PATCH] gdbsupport/common-inferior.c: Fix mingw build
Date: Mon, 31 Mar 2025 14:23:46 +0200 [thread overview]
Message-ID: <1d68bef7-5917-438f-a6ee-58ce73b2fbfd@suse.de> (raw)
In-Reply-To: <20250331111358.200153-1-lancelot.six@amd.com>
On 3/31/25 13:13, Lancelot SIX wrote:
> A recent change (512ca2fca4b "gdb: split up
> construct_inferior_arguments") introduced a build failure for mingw:
>
> CXX common-inferior.o
> .../gdb/gdbsupport/common-inferior.cc: In function ‘std::string escape_characters(const char*, const char*)’:
> .../gdb/gdbsupport/common-inferior.cc:62:20: error: ‘argv’ was not declared in this scope; did you mean ‘arg’?
> 62 | if (strpbrk (argv[i], special))
> | ^~~~
> | arg
> .../gdb/gdbsupport/common-inferior.cc:62:25: error: ‘i’ was not declared in this scope
> 62 | if (strpbrk (argv[i], special))
> | ^
>
> This patch fixes that.
>
Hi Lancelot,
thanks for fixing this.
I've reproduced the problem, and verified that the patch fixes it.
I've looked at the patch introducing the problem, and I agree with the fix.
Approved-By: Tom de Vries <tdevries@suse.de>
FWIW, there's a pre-existing style issue here, the strpbrk should be
explicitly tested against nullptr, but I noticed the same issue in
another file, so I propose that we leave this patch as is, and that I
follow up with a patch taking care of that issue in both files.
Thanks,
- Tom
> Change-Id: I07ade607bc4516627b433085b07d9d198d8e4b4a
> ---
> gdbsupport/common-inferior.cc | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gdbsupport/common-inferior.cc b/gdbsupport/common-inferior.cc
> index 4b868294062..e544780bd4b 100644
> --- a/gdbsupport/common-inferior.cc
> +++ b/gdbsupport/common-inferior.cc
> @@ -59,7 +59,7 @@ escape_characters (const char *arg, const char *special)
> #ifdef __MINGW32__
> bool quoted = false;
>
> - if (strpbrk (argv[i], special))
> + if (strpbrk (arg, special))
> {
> quoted = true;
> result += quote;
>
> base-commit: 7109ea04ac79f641c48b6a1e6a2f3fc38a83c2ed
next prev parent reply other threads:[~2025-03-31 12:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-31 11:13 Lancelot SIX
2025-03-31 12:23 ` Tom de Vries [this message]
2025-03-31 13:06 ` Lancelot SIX
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=1d68bef7-5917-438f-a6ee-58ce73b2fbfd@suse.de \
--to=tdevries@suse.de \
--cc=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=lancelot.six@amd.com \
/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