Re: Newbie idiotic questions.

Alexander Viro (viro@math.psu.edu)
Sun, 17 Jun 2001 18:33:45 -0400 (EDT)


On Sun, 17 Jun 2001, Daniel Phillips wrote:

> typeof? It's rather popular in the kernel already. Besides, who is going to

Really? 5 instances in PPC arch-specific code, 1 (absolutely gratitious)
in drivers/mtd, 2 - in m68k (also useless), 4 - in drivers/video, 2 -
in AFFS and 1 - in netfilter.

I wouldn't call it "rather popular".

> compile this with anything other than gcc?

>
> I don't see your point about greppability.

You are making the types it is applied to harder to deal with wrt. global
search.

But the real issue here is that preprocessor is not a way to get
polymorphism. And that would be the only context where typeof might
have any use. Trying to turn C into the things it isn't is always a bad
idea - had been proven many times. starting at least with Bourne shel
(check the v7 sh source if you don't know what I'm refering to).

-
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/