This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Obvious] ARI fixes: OP eol rules files starting with d, e or f


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]