Coding style
Richard Earnshaw
rearnsha@arm.com
Sat May 3 09:54:00 GMT 2003
> makes sense, but when contracted into:
>
> > int
> > max_register_size (struct gdbarch *gdbarch)
> > {
> > struct regcache_descr *descr = regcache_descr (gdbarch);
> >
> > return descr->max_register_size;
> > }
>
> or:
>
> > int
> > max_register_size (struct gdbarch *gdbarch)
> > {
> > struct regcache_descr *descr = regcache_descr (gdbarch);
> > return descr->max_register_size;
> > }
>
> things get pretty arbitrary. Is "descr" a declaration or code body?
I find the break helpful to delimit the extent of the declarations. I'm
not too bothered if there is code in the declarations, provided it's
straight-forward initializations, not complex conditional operations and
the like.
R.
More information about the Gdb
mailing list