This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] microMIPS support
On Wed, 25 Apr 2012, Joel Brobecker wrote:
> > Actually I keep getting confused about the style expected for aggregate
> > types, especially in the context of initialisers. So for example is this
> > correct:
> [...]
> > or should that be written yet differently? What if that's defined at the
> > file scope:
>
> Yeah, I am not sure what the proper kosher style would be in this case,
> or if this has been discussed and decided, but I would tend to say that
> the same style should be used regardless of scope.
I am unconvinced. We make an exception for global functions and do not
indent their brackets. However we do indent nested (local) functions.
Have a look at elf/dl-deps.c in glibc sources (that follow the same style
that we do) for an example -- there's a nested "preload" function in
"_dl_map_object_deps" and its indented just as any other entity would be
(personally I would find an unindented nested block confusing).
So why should we treat all the other kinds of entities differently?
What's the rationale? I think all file-scope entities look better
unindented, not just functions.
That's my personal view anyway, feel free to differ. Though I have to
admit my view is not particularly strong here and then TBH file-scope
structures in the glibc source referred above are indeed indented, so I am
not going to argue either way if there's any doubt.
Maciej