Skip to contentSkip to conversation

Kernel coding style for Extended Attributes.

RFC Michael S. Zick 3 participants 4 messages Jun 3, 2009

lore
Share & tools
lore
#0 lore raw

Group;

I notice two different styles being used:
__attribute__ (( ....
__attribute__(( ....

The gcc documentation does not make a comment on this, in fact, the extended attribute doc page uses both. ;)

As a matter of fact, there are macros defined that have both (not at once) expansions.

Is there a recommended style for the kernel source?

Mike

#1 lore raw
Quoted 2 lines · Michael S. Zick

Is there a recommended style for the kernel source?

I think the recommended style is:

"Hide them behind a macro so that they never show up in the source".

and then basically nobody will care about whether there is a space between the __attribute__ and '(('.

Linus

#2 lore raw
Quoted 9 lines · Linus Torvalds
Quoted 2 lines · Michael S. Zick

Is there a recommended style for the kernel source?

I think the recommended style is:

"Hide them behind a macro so that they never show up in the source".

That seems to be the general consensus in (/by) practice.

Thanks,
Mike

Quoted 11 lines

and then basically nobody will care about whether there is a space between the __attribute__ and '(('.

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#3 lore raw
Quoted 4 lines · Michael S. Zick
Quoted 3 lines · Linus Torvalds
Quoted 1 line · Michael S. Zick
Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Is there a recommended style for the kernel source?

I think the recommended style is:

"Hide them behind a macro so that they never show up in the source".

That seems to be the general consensus in (/by) practice.

Use __section() to define a section.
See init.h for usage and compiler.h for definition.

Sam