Re: non-gcc linux? (was Re: Where did kgcc go in 2.4.0-test10?)

From: Kai Henningsen (kaih@khms.westfalen.de)
Date: Sat Nov 04 2000 - 06:30:00 EST


hch@caldera.de (Christoph Hellwig) wrote on 02.11.00 in <200011022106.WAA18428@ns.caldera.de>:

> In article <3A01D463.9ADEF3AF@Rikers.org> you wrote:
> > As is being discussed here, C99 has some replacements to the gcc syntax
> > the kernel uses. I believe the C99 syntax will win in the near future,
> > and thus the gcc syntax will have to be removed at some point. In the
> > interim the kernel will either move towards supporting both, or a
> > quantum jump to support the new gcc3+ compiler only. I am hoping a
> > little thought can get put into this such that this change will be less
> > painful down the road.
>
> BTW: the C99 syntax for named structure initializers is supported from
> gcc 2.7.<something> on. But a policy decision has been take to use
> gcc synta in kernel.

Just so everyone knows what we're talking about, some examples from C99:

33 EXAMPLE 9 Arrays can be initialized to correspond to the elements of an
enumeration by using designators:

enum { member_one, member_two };
const char *nm[] = {
        [member_two] = "member two",
        [member_one] = "member one",
};

34 EXAMPLE 10 Structure members can be initialized to nonzero values
without depending on their order:

div_t answer = {
        .quot = 2,
        .rem = -1
};

35 EXAMPLE 11 Designators can be used to provide explicit initialization
when unadorned initializer lists might be misunderstood:

struct { int a[3], b; }
w[] = {
        [0].a = {1},
        [1].a[0] = 2
};

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



This archive was generated by hypermail 2b29 : Tue Nov 07 2000 - 21:00:16 EST