bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnulib] "# " versus " #" when indenting preprocessor directives


From: Paul Eggert
Subject: [Bug-gnulib] "# " versus " #" when indenting preprocessor directives
Date: 11 Aug 2003 11:11:56 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

While we're on the subject of indenting preprocessing directives,
would anyone object to using this style:

  #ifndef POINTER_TYPE
   #ifdef __STDC__
    #define POINTER_TYPE void
   #else
    #define POINTER_TYPE char
   #endif
  #endif

instead of this style:

#  ifndef POINTER_TYPE
#   ifdef __STDC__
#    define POINTER_TYPE void
#   else
#    define POINTER_TYPE char
#   endif
#  endif

The former style is more readable -- the latter style looks to me like
traditional Fortran with its weird insistence on column 1.  Also I'd
find it a bit more convenient to grep for preprocessor stuff with the
former style.

I think the main reason we have been using the latter style is K&R
compatibility, but that's no longer an issue with gnulib.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]