This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [Obvious] ARI fixes: OP eol rules files starting with d, e or f
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Pierre Muller <muller at ics dot u-strasbg dot fr>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 7 Oct 2009 09:18:20 -0700
- Subject: Re: [Obvious] ARI fixes: OP eol rules files starting with d, e or f
- References: <000001ca46dd$09a7a960$1cf6fc20$@u-strasbg.fr>
> PS: The dwarf_decode_macros code still is a bit "non-conformant" as
> lines stop with "?" with his also an operator, no? But these are not
> yet listed as errors by the ARI script, should it? If yet, how should
> the "clean" code look like?
(I'm not a big fan of the "?" operator, even if I see how it can be
convenient).
The GNU Coding Standards confirm that we should split before the "?"
operator. I initially had no preference wrt the ARI, but since the GCS
shows examples involving that operator, I guess we should add a rule
for it.
How it should look:
complaint (&symfile_complaints,
_("debug info with no main source gives macro %s "
"on line %d: %s"),
macinfo_type == DW_MACINFO_define ?
_("definition") :
macinfo_type == DW_MACINFO_undef ?
_("undefinition") :
_("something-or-other"), line, body);
Honestly, it seems to me that a local variable and if statements will
make the code more readable than it is right now.
Other, I believe the formatting that the GCS recommends the use of
extra parents in order to help tools such as emacs. So I propose
the following formatting:
complaint (&symfile_complaints,
_("debug info with no main source gives macro %s "
"on line %d: %s"),
(macinfo_type == DW_MACINFO_define
? _("definition")
: (macinfo_type == DW_MACINFO_undef
? _("undefinition")
: _("something-or-other"))),
line, body);
My 2 cents...
--
Joel