conventions for includes

Hi,

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.

Comments? Do you think this is "overconventioning"?

Cheers Kaspar

Hey,

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.

Cheers, Oleg

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.

+1

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").

I thought this was already part of our coding conventions?

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.

+1

Cheers, Ludwig

Hi!

>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").

I thought this was already part of our coding conventions?

Oh, you're right. Sorry.

Cheers, Oleg

Hi,