From: Paul Brook <paul@codesourcery.com>
To: "Mark Kettenis" <mark.kettenis@xs4all.nl>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] Avoid gcc specific compiler flags
Date: Tue, 07 Mar 2006 17:46:00 -0000 [thread overview]
Message-ID: <200603071519.38581.paul@codesourcery.com> (raw)
In-Reply-To: <22344.192.87.1.22.1141741508.squirrel@webmail.xs4all.nl>
> I was talking about the following fragment:
>
> + set nowarnings [lsearch -exact $options nowarnings]
> + if {$nowarnings != -1} {
> + if [target_info exists gdb,nowarnings_flag] {
> + set flag "additional_flags=[target_info gdb,nowarnings_flag]"
> + } else {
> + set flag "additional_flags=-w"
> + }
> + set options [lreplace $options $nowarnings $nowarnings $flag]
>
> There's a double $nowarnings on that last line. or is that intentional?
> In that case I don't understand this code completely, and it needs a
> comment to explain it.
That's deliberate.
The code replaces the "nowarnings" option with additional_flags=[something]
$nowarnings is the index of the nowarnings option in the list of options.
The lreplace function replaces a range of list items. In this case we want to
replace a single list element so the start and end of the range are the same.
I've added the following comment and applied the patch.
# Replace the "nowarnings" option with the appropriate additional_flags
# to disable compiler warnings.
Paul
next prev parent reply other threads:[~2006-03-07 15:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-07 5:02 Paul Brook
2006-03-07 5:23 ` Mark Kettenis
2006-03-07 15:19 ` Paul Brook
2006-03-07 16:52 ` Mark Kettenis
2006-03-07 17:46 ` Paul Brook [this message]
2006-03-07 18:45 ` Mark Kettenis
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=200603071519.38581.paul@codesourcery.com \
--to=paul@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=mark.kettenis@xs4all.nl \
/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