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>, "'Andreas Schwab'" <schwab at linux-m68k dot org>
- Cc: <gdb-patches at sourceware dot org>
- Date: Thu, 10 Jan 2013 13:27:31 +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> <m2vcbsl7xe.fsf@igel.home> <834njcp160.fsf@gnu.org>
Hi all,
I would like to know what the status of this patch is,
and more generally of the ARI rule: "Avoid assignment inside if statement".
Eli wanted to challenge this rule,
but others seems to be in favor...
I really do find code easier to read if assignments are done
before the if statement, but this is due to my pascal background,
which forbids it.
Pierre Muller,
as ARI maintainer.
> -----Message d'origine-----
> De?: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Eli Zaretskii
> Envoyé?: lundi 24 décembre 2012 04:41
> À?: Andreas Schwab
> Cc?: pierre.muller@ics-cnrs.unistra.fr; gdb-patches@sourceware.org
> Objet?: Re: [RFA] (cli/cli-cmds.c) ARI fix: Avoid assignment inside if
> statement
>
> > From: Andreas Schwab <schwab@linux-m68k.org>
> > Cc: Pierre Muller <pierre.muller@ics-cnrs.unistra.fr>, gdb-
> patches@sourceware.org
> > Date: Sun, 23 Dec 2012 23:28:45 +0100
> >
> > Eli Zaretskii <eliz@gnu.org> writes:
> >
> > > Since when is that bad C, so much so that we would need to enforce it?
> >
> > It's part of the GNU coding standards.
>
> Which says "Try not to...".
>
> FWIW, Emacs sources are replete with such assignments, and I don't see
> anything wrong with that in the first place.
>
> So yes, I guess I'm challenging this ARI rule.