Subject: Re: Are gcc syntax extensions ok to use?
To: John Fremlin <chief@bandits.org>
From: Rafal Boni <rafal@mediaone.net>
List: tech-kern
Date: 04/22/2001 01:19:42
In message <m2g0f1it2e.fsf@boreas.yi.org.>, you write: 

-> Specifically, named struct field initializers, for example,
-> 
-> static struct wsscreen_descr wssd_stdscreen = {
-> 	name: "LCD",
-> 	ncols: 80,
-> 	nrows: 30,
-> 	capabilities: 0 /* can't do anything ;-) */
-> }

This is *evil*, even if it provides extra documentation in the same
space as the data.  I've noticed things like this pop up in Linux 
code, and every time I see it I have to wonder what language the 
construct is written in.  The cost of the extra documentation is
that whoever has to touch the thing again has to figure out exactly
what this new syntax means and how it's safe to (ab)use it.

IMNSHO, the structure definition should serve as adequate documentation
for the fields in the structure, even if it's located in a header file 
somewhat removed from the declaration.

Please avoid these,
--rafal

----
Rafal Boni                                                  rafal@mediaone.net