Named initialisers and other hilarity

Keith Whitwell keith at tungstengraphics.com
Wed Sep 20 01:31:32 PDT 2006


Daniel Stone wrote:
> Hi,
> I was diving through some KDrive code today and it annoyed me enough to
> wonder seriously about named initialisers.  A quick straw poll on IRC
> suggests that we really want named initialisers, inlines (goodbye
> hundred-line macros of despair), mixed code and declarations[0], and
> variadic macros (goodbye DPRINTF((x))).
> 
> Are there any platforms that either support 7.x, or will realistically
> support 7.x quite soon, that don't support these features?  Full C99
> compliance is uninteresting since a) the features aren't that
> interesting, and b) gcc doesn't even do it; but mandating those four
> specific features would be magic.
> 
> Cheers,
> Daniel
> 
> [0]: Stuff like:
>        for (int i = 0; i < foo; i++)
>      not:
>        foo = bar;
>        doSomething();
>        char *baz = "i cannot write code";
>        doLotsOfOtherThings();
>        quux(baz);
> 

I don't think mixed code & declarations is such a great win as you 
illustrate it's open to some nasty abuse.  Of course it's nice to 
declare a loop variable like that, but beyond that it's a bit of a 
gimmick.

I'm all for the others, the one I'd also argue for (maybe it already is 
assumed) is the existence of a native 64 bit integer type.

Most people working on X would be suprised to hear that inlines for 
instance weren't permitted - the world has moved on...

Keith



More information about the xorg mailing list