public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Coding style
@ 2003-05-02 10:10 Mark Kettenis
  2003-05-02 17:32 ` Joel Brobecker
  2003-05-02 18:46 ` Andrew Cagney
  0 siblings, 2 replies; 4+ messages in thread
From: Mark Kettenis @ 2003-05-02 10:10 UTC (permalink / raw)
  To: gdb

Hi folks,

I've been noticing that some folks (most notably Andrew :-) have been
very "economical" in the use of empty lines in function bodies.  I
know that the GNU coding standards say that one should not use too
many of those, but I think there are good reasons to keep with the
tradition of seperating the declaration of local variables from
geneuine code by an empty line, e.g.:

int
max_register_size (struct gdbarch *gdbarch)
{
  struct regcache_descr *descr = regcache_descr (gdbarch);

  return descr->max_register_size;
}

instead of:

int
max_register_size (struct gdbarch *gdbarch)
{
  struct regcache_descr *descr = regcache_descr (gdbarch);
  return descr->max_register_size;
}

I keep finding the first much more legible.  AFAICT all GNU projects
that take the coding standards serious use that style.  By the way,
using whitespace to logically group lines together within a function
body is generally a good idea too.  Well, IMHO of course...

Anyway, I hope no one will object if add a few extra newlines
here'n'there when I feel it's appropriate?

Mark

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-05-03  9:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-02 10:10 Coding style Mark Kettenis
2003-05-02 17:32 ` Joel Brobecker
2003-05-02 18:46 ` Andrew Cagney
2003-05-03  9:54   ` Richard Earnshaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).