[riot-devel] conventions for includes

Oleg Hahm oliver.hahm at inria.fr
Fri Sep 27 16:29:43 CEST 2013


> looking at Christian's commit, I'm wondering whether we should have
> some conventions regarding the ordering of includes.
> Right now, it's rather chaotic. At least we're not mixing standard
> includes (stdint.h) with our own (kernel.h).
> I propose having standard includes first, then a new line, then our
> system includes, then the app/lib specific stuff. Blocks seperated by
> an empty line. Ordered alphabetically, as any other ordering is
> totally arbitrary.
in general: +1

However, I would not insist on alphabetical ordering, because in some cases
the ordering does matter.

Additional, I would suggest to use angle brackets only for standard libc
includes (e.g. <stdio.h> or <inttypes.h>), and use quotes for RIOT's own
headers (e.g. "msg.h" or "sixlowpan/mac.h").

> Comments? Do you think this is "overconventioning"?
It might be a bit too much, but I think it's necessary if we want our code to
look neat and understandable.

printk(KERN_EMERG "PCI: Tell willy he's wrong\n");

More information about the devel mailing list