[U-Boot] nested defines coding style

Mike Frysinger vapier at gentoo.org
Sat Aug 20 00:31:40 CEST 2011


On Friday, August 19, 2011 17:57:50 Jeroen Hofstee wrote:
> I couldn't (easily) find a doc for coding style regarding defines in
> u-boot. I commenly don't indent preprocessor macro's, but when reading
> code from some one else code I tend to prefer single space indentation
> for these (before the #). Is there a standard for this in u-boot?

i prefer:
#if 1
# if 2
#  if 3
...
#  else
...
#  endif
# endif
#endif

but doing this without the space after the "#" is acceptable.  these two 
styles are your only options, but i dont believe there is a rule as to which 
you pick other than "if you're the maintainer of the code in question, use 
whichever you like".

also, please dont hijack threads.  start a new e-mail from scratch ... dont 
just hit "reply" to any old e-mail and erase the subject/body.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110819/c5c4a8f7/attachment.pgp 


More information about the U-Boot mailing list