This is the mail archive of the gdb@sourceware.cygnus.com 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]

#include indenting (Was: [PATCH] Replace ../include/wait.h ....)


Hello,

I got asked:

> PS Andrew, concering coding-style, current practice in a lot of GNU
> packages is to use extra whitespace after `#' like in the following
> example:
> 
> #ifndef foobar
> # ifdef foo
> #  define foobar foo
> # else
> #  define foobar bar
> # endif
> #endif
> 
> This makes things a bit more readable.  The patch below doesn't do
> this, but is it OK to use this style in GDB in the future?  

I'd just try to keep things consistent with the code already found in
the relevant source file.  Given tha t both alternatives have advantages
and disadvantages the choice is really somewhat arbitrary.

Looking through the GDB sources this will typically translate into
continueing with the:

#if ..
#define
#endif

style for all but a few files.

One thing, since GDB now assumes ISO-C, people (read me) should remember
to make use of the #elif directive.

	Andrew

PS: Am I impartial?  I got curious and looked at some older code of mine
and found examples where I'd used both styles in the same file. Ugh :-(

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