[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why not C99 designated initializer syntax?
From: |
Daniel Colascione |
Subject: |
Re: Why not C99 designated initializer syntax? |
Date: |
Mon, 12 Dec 2016 14:11:31 -0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
On Mon, Dec 12 2016, Philipp Stephani wrote:
> Daniel Colascione <address@hidden> schrieb am Mo., 12. Dez. 2016 um 22:56 Uhr:
>
> Why are we writing code like this?
>
> struct font_driver const nsfont_driver =
> {
> type: LISPSYM_INITIALLY (Qns),
> case_sensitive: true,
> ...
> };
>
> and not like this?
>
> struct font_driver const nsfont_driver =
> {
> .type = LISPSYM_INITIALLY (Qns),
> .case_sensitive = true,
> ...
> };
>
> The former is a deprecated GCC extension. The latter is the standard.
> We need C99 these days anyway.
>
> Probably just an accident. There doesn't seem to be a ban on C99 designated
> initializers; for example, I've added
> some to emacs-module.c
An accident is possible. It's just curious that this syntax has
appeared in brand-new code.