This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
#include indenting (Was: [PATCH] Replace ../include/wait.h ....)
- To: GDB Discussion <gdb at sourceware dot cygnus dot com>
- Subject: #include indenting (Was: [PATCH] Replace ../include/wait.h ....)
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Thu, 10 Feb 2000 17:12:33 +1100
- Organization: Cygnus Solutions
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 :-(