[obv] Indent prototypes so they do not get into tags
Mark Kettenis
mark.kettenis@xs4all.nl
Sun Jul 24 20:26:00 GMT 2011
> Date: Sat, 23 Jul 2011 19:42:25 +0200
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
>
> On Sat, 23 Jul 2011 19:14:11 +0200, Mark Kettenis wrote:
> > > -static struct value *
> > > -dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
> > > - const gdb_byte *data, unsigned short size,
> > > - struct dwarf2_per_cu_data *per_cu,
> > > - LONGEST byte_offset);
> > > +static struct value *dwarf2_evaluate_loc_desc_full (struct type *type,
> > > + struct frame_info *frame,
> > > + const gdb_byte *data,
> > > + unsigned short size,
> > > + struct dwarf2_per_cu_data *per_cu,
> > > + LONGEST byte_offset);
> >
> > Bleah, that last one really becomes unreadable this way. Isn't there
> > a better way to this by bending the GNU coding style rules slightly in
> > a different way?
>
> A agree it is ugly. GNU indent according to GCS (GNU Coding Standards):
>
> static struct value *dwarf2_evaluate_loc_desc_full (struct type *type,
> struct frame_info *frame,
> const gdb_byte * data,
> unsigned short size,
> struct dwarf2_per_cu_data
> *per_cu,
> LONGEST byte_offset);
>
> The other usual possibilitiesone can find in GDB sources are:
>
> static struct value *
> dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
> const gdb_byte *data, unsigned short size,
> struct dwarf2_per_cu_data *per_cu,
> LONGEST byte_offset);
I think this is by far the most readable one. I even think there was
some sort of consensus among GDB developers about using this style
some years ago.
> or:
> static struct value *dwarf2_evaluate_loc_desc_full
> (struct type *type, struct frame_info *frame, const gdb_byte *data,
> unsigned short size, struct dwarf2_per_cu_data *per_cu, LONGEST byte_offset);
>
> I really do not mind which one, as long as
> dwarf2_evaluate_loc_desc_full is not in tags, none of the
> possibilities look as a clear win to me.
More information about the Gdb-patches
mailing list