Subject: Re: Are gcc syntax extensions ok to use?
To: John Fremlin <chief@bandits.org>
From: Christoph Hellwig <hch@lst.de>
List: tech-kern
Date: 04/22/2001 14:10:56
On Sun, Apr 22, 2001 at 03:09:29AM +0100, John Fremlin wrote:
> 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 ;-) */
> }
> ;

IMHO you should use (unlike Linux) the C99-Syntax for it, it has been
supported by gcc for ages (since about 2.7 IIRC) and _is_ standard
unlike gcc's extension of the day (TM).

It would look like the following then:

static struct wsscreen_descr wssd_stdscreen = {
	.name =		"LCD",
	.ncols =	80,
	.nrows =	30,
	capabilities:	0, /* can't do anything ;-) */
};

The trailing comma is optional but makes the diffs to add additional fields
smaller...

	Christoph

-- 
Whip me.  Beat me.  Make me maintain AIX.