This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [RFA] (cli/cli-cmds.c) ARI fix: Avoid assignment inside if statement
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: "'Eli Zaretskii'" <eliz at gnu dot org>
- Cc: <gdb-patches at sourceware dot org>
- Date: Sun, 23 Dec 2012 22:57:45 +0100
- Subject: RE: [RFA] (cli/cli-cmds.c) ARI fix: Avoid assignment inside if statement
- References: <001201cde13f$af3ad4b0$0db07e10$%muller@ics-cnrs.unistra.fr> <837go8pnxn.fsf@gnu.org>
> -----Message d'origine-----
> De?: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Eli Zaretskii
> Envoyé?: dimanche 23 décembre 2012 20:29
> À?: Pierre Muller
> Cc?: gdb-patches@sourceware.org
> Objet?: Re: [RFA] (cli/cli-cmds.c) ARI fix: Avoid assignment inside if
> statement
>
> > From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
> > Date: Sun, 23 Dec 2012 19:59:49 +0100
> >
> > Looks almost obvious, but
> > as it's the first of that kind,
> > I thought I will send it as RFA nonetheless...
> >
> > Can similar changes be committed as obvious?
> > They usually require some formatting changes,
> > but generated behavior should not change.
> >
> >
> > Pierre Muller
> > as ARI maintainer
> >
> >
> > 2012-12-20 Pierre Muller <muller@sourceware.org>
> >
> > ARI fixes: Assignment within if rule.
> > * cli/cli-cmds.c (shell_escape): Do not set variable value
inside
> > if statement.
> > (edit_command): Likewise.
>
> Since when is that bad C, so much so that we would need to enforce it?
Eli, as you know,
I am not a C specialist at all...
But I didn't invent that rule either.
This rule part of gdb_ari.sh since it's introduction in CVS ss repository
back in 2002.
It's probably now your chance to challenge this rule...
I would tend to agree that an assignment should be a statement on it's
own, but you could rightly consider this as a 'pascal' language
preference!
Pierre Muller
both ARI and pascal language support maintainer!