From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: Why not C99 designated initializer syntax? Date: Mon, 12 Dec 2016 22:07:05 +0000 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d0444ea69a0c39805437d5376 X-Trace: blaine.gmane.org 1481580559 27400 195.159.176.226 (12 Dec 2016 22:09:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 12 Dec 2016 22:09:19 +0000 (UTC) To: Daniel Colascione , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 12 23:09:15 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGYmX-0006RT-N1 for ged-emacs-devel@m.gmane.org; Mon, 12 Dec 2016 23:09:13 +0100 Original-Received: from localhost ([::1]:33795 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGYmb-0001ic-RT for ged-emacs-devel@m.gmane.org; Mon, 12 Dec 2016 17:09:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGYm3-0001iK-Vm for emacs-devel@gnu.org; Mon, 12 Dec 2016 17:08:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cGYm0-0000HH-O4 for emacs-devel@gnu.org; Mon, 12 Dec 2016 17:08:43 -0500 Original-Received: from mail-wj0-f174.google.com ([209.85.210.174]:35668) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cGYm0-0000Bj-Fk for emacs-devel@gnu.org; Mon, 12 Dec 2016 17:08:40 -0500 Original-Received: by mail-wj0-f174.google.com with SMTP id v7so84872651wjy.2 for ; Mon, 12 Dec 2016 14:08:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=cj/8HJ6iciOAuh5u9p3KobymjA3xmNp/OQYxWZSd73M=; b=GBAU+O2UweWwpUIfldGTSNeoyTCsn7MgFc++h+e2pQ63nvT3hciZOG0j+D8vKjlaq1 HqQ0B4vB46eUxiXxGmqCnoMY7Gmw6jLLECdQDLdxay7ocThaYQ3azxB8xoFue/aiZfnS /qn5+aTY17u4UKeVe4Vsf7JBPeKhfqGDyfebiriDyFF74T9M/fPhT+BGswBgNm8FbIV6 51LKVd89R79Mxrkvhq3NKiRVrDJB459EDAljuvievhXGS7BGty1d5hnIijn/kJJXjGya wRVKUtvGUbo0Ay8nyqcgNoVY6TlKU5wmedoEnzRjg8AH21K2c+aAmhakILQxjyXKVqLb TPjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=cj/8HJ6iciOAuh5u9p3KobymjA3xmNp/OQYxWZSd73M=; b=GZG12/JjMzyMzNNnwDJ3DrTBSbXDgLkLww/n3FibSAQd1lFX0dBkE+sRVdNKW1lnHc AP+NBtNnPqxwqTrKc+XYe0RXV09sEIrb5qcZhSxXL1zj+uNQ3ZyWgBZEZEdJsgj9nu8n WH/dotxFMLiTqe8imUtFaXT4ROP9nDej/n6cGemZckyvnuZqqIpebbzmQ3H12PiHp8RK qbEnPFs+N60ZOC6PgUCXZg/gp0i50OMZs+D0vNAErCtZgZUDihvx+kIPMvbNz/oIkgZA z9cfLogvy8ZrlTVx4WpQVFr5ZIa8zjkkV+JdmtW6p+i8dGDPJ49DLbAumqyWqnv5dZBD FLPw== X-Gm-Message-State: AKaTC02p+4xLNK+V2Eq+Kw8UffgrbFnLxSV8zmPbirCt+Y597LBUx44SkLZvgR8bONistkDDxjkORGRzcWOazQ== X-Received: by 10.194.18.196 with SMTP id y4mr85075494wjd.73.1481580436569; Mon, 12 Dec 2016 14:07:16 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.210.174 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:210379 Archived-At: --f46d0444ea69a0c39805437d5376 Content-Type: text/plain; charset=UTF-8 Daniel Colascione 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 --f46d0444ea69a0c39805437d5376 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Daniel= Colascione <dancol@dancol.org&= gt; schrieb am Mo., 12. Dez. 2016 um 22:56=C2=A0Uhr:

Why are we writing code like this?

struct font_driver const nsfont_driver =3D
=C2=A0 {
=C2=A0 type: LISPSYM_INITIALLY (Qns),
=C2=A0 case_sensitive: true,
=C2=A0 ...
=C2=A0 };

and not like this?

struct font_driver const nsfont_driver =3D
=C2=A0 {
=C2=A0 .type =3D LISPSYM_INITIALLY (Qns),
=C2=A0 .case_sensitive =3D true,
=C2=A0 ...
=C2=A0 };

The former is a deprecated GCC extension.=C2=A0 The latter is the standard.=
We need C99 these days anyway.


Probably just an a= ccident. There doesn't seem to be a ban on C99 designated initializers;= for example, I've added some to emacs-module.c
--f46d0444ea69a0c39805437d5376--