[BRLTTY] readable struct initialisation
Mario Lang
mlang at delysid.org
Sat Mar 4 05:56:04 EST 2006
Nicolas Pitre <nico at cam.org> writes:
> On Fri, 3 Mar 2006, Mario Lang wrote:
>
>> Hi.
>>
>> Wouldn't this kind of syntax make more sense to use? The kernel does
>> all struct initialisations that way, and I have to say, I find the readability
>> of code extremely pleasant.
>>
> [...]
>> + name: "Modular 20+4",
>> + identifier: 0X80,
>> + columns: 20,
>
> Actually, that format is not used by the kernel anymore. That was a
> non-standard gcc extension which is being deprecated.
>
> What you probably want is the C99 standard equivalent:
>
> .name = "Modular 20+4",
> .identifier = 0X80,
> .columns = 20,
>
> etc.
Oh right, of course! Thanks for pointing this out.
--
CYa,
Mario
More information about the BRLTTY
mailing list