From: Pedro Alves <pedro@codesourcery.com>
To: "Pierre Muller" <muller@ics.u-strasbg.fr>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA-v2] testsuite: Avoid auto-import warning on cygwin/mingw
Date: Fri, 02 Oct 2009 18:09:00 -0000 [thread overview]
Message-ID: <200910021909.47860.pedro@codesourcery.com> (raw)
In-Reply-To: <009701ca4332$114bda50$33e38ef0$@u-strasbg.fr>
On Friday 02 October 2009 08:29:24, Pierre Muller wrote:
>
> > Did you mean 'lappend options'?
>
> No, appending to options
> would mean that this addition would be parsed by the loop
> 'foreach opt $options {'
> of line 1713,
> while adding it to new_options like it
> is done also below for 'shlib_load'.
>
>
> Furthermore, I always feel uncomfortable
> when code inside a loop changes the variable
> on which the loop is performed (options in that case.)
> Wouldn't it be better to also
> append to new_options for the two conditions above?
>
> So, what about this?
Hmmm, I would have thought that foreach would still
only iterate over the original elements of $options (since foreach
takes the values of $options, not the variable reference),
no matter if you lappend to options; or am I confused, and
does it really keep iterating over newly append items?
It would seem like those "lappend options" are actually dead
code. Otherwise, appending to `options' means that those
new items always ended on $new_options after
all the original options, but I don't think it matters
here. Either patch looks ok to me, although you got me a
bit confused with tcl's foreach now. :-)
--
Pedro Alves
next prev parent reply other threads:[~2009-10-02 18:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-01 22:09 [RFA] " Pierre Muller
2009-10-02 0:24 ` Pedro Alves
2009-10-02 7:29 ` [RFA-v2] " Pierre Muller
2009-10-02 18:09 ` Pedro Alves [this message]
2009-10-02 20:57 ` Tom Tromey
2009-10-02 21:35 ` Pierre Muller
2009-10-02 22:19 ` Pedro Alves
2009-10-02 22:27 ` Pierre Muller
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=200910021909.47860.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=muller@ics.u-strasbg.fr \
/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