Re: [PATCH] 2.5.27 sysctl

From: Marcin Dalecki (dalecki@evision.ag)
Date: Mon Jul 22 2002 - 08:02:04 EST


Alexander Viro wrote:
>
> On Mon, 22 Jul 2002, Marcin Dalecki wrote:
>
>
>>>The kernel is full of GNUisms, and this one is actually usefull.
>>
>>Its is not half as full as you may think.
>
>
> Trailing comma in enums has _exactly_ the same status as .foo = bar in
> structure initializers. Both appear in C99 and were compiler-specific
> extensions before that.

Yes the C99 people did give in on this point :-). But only until
recently. And really the only way to find out what the warinigs
are about is to have a look at cparse.y...

> If -pedantic is unhappy about one but not another - take it with gcc
> folks, it's a bug in gcc.
>
> Speaking of GNUisms, inline assembler is one and it's by far the worst
> obstacle to portability.

Sure, but this extension is actually a justifyed one.

> Speaking of *REALLY* ugly stuff - may I point
> you to abuses of ##? Yes, it's legal C. No, using it is a Bad Idea(tm).
> And the actual uses of _that_ one in the tree can give you the second
> look at your breakfast - grep around and you'll see.

Da, kanieczna. Ja znaju: It's resulting in semi "self modifying" code.
Sometimes usefull but not in 80% where they are actually used is the
({ ... }) extension for example as well. In most of the cases where its
used we should simply rely on the fact that gcc got now much better at
doing function inlining instead. See the spinlock patch for example.
Best abuse example are the byte swapping macros...

But one quite justifyed example of usage is the
wait_event_interruptible(), where it's used to assert repeated condition
evaluation. However this puts the fact aside that
wait_event_interruptible() isn't a polite abstraction in first place...

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



This archive was generated by hypermail 2b29 : Tue Jul 23 2002 - 22:00:38 EST