From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: Why named structs and unions? C11 supports anonymous structs and unions Date: Mon, 12 Feb 2018 12:22:53 -0800 Message-ID: <65cfb499-1ef2-b12f-bc12-4063d879d33d@dancol.org> References: <223f1299-8dd8-4c0f-9aed-b216fa913042@email.android.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1518466924 26893 195.159.176.226 (12 Feb 2018 20:22:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 12 Feb 2018 20:22:04 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 Cc: Emacs Development To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 12 21:21:59 2018 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 1elKb8-0003tW-KZ for ged-emacs-devel@m.gmane.org; Mon, 12 Feb 2018 21:21:10 +0100 Original-Received: from localhost ([::1]:48788 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elKdA-0003Fz-DX for ged-emacs-devel@m.gmane.org; Mon, 12 Feb 2018 15:23:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elKcz-0003Co-UN for Emacs-devel@gnu.org; Mon, 12 Feb 2018 15:23:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1elKcy-0005Tt-U0 for Emacs-devel@gnu.org; Mon, 12 Feb 2018 15:23:05 -0500 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:47936) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1elKcy-0005Sv-Ml for Emacs-devel@gnu.org; Mon, 12 Feb 2018 15:23:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject; bh=TFkmOM3hU3ApWMjcuJe5RNB8tu/RZsvkvX5en6klyJw=; b=ibG4xscx0WmxxAlvOPvZDzqlPzjtGM8ualHP6NeMWnDpm4HUkSq8ukag34fZtMNpVMFIvoWnFAW7+snYeSSCD3g7/kya20mj4CfgVuufm5qoOTaZ+Y+2UnLfXXQZ8bgg273me0IaowYUfuwxmW/X4fjH/nIeDXigx1m9yTOxHEajW75Ps6J3D3gwVAJSOZcP5kg95EveMQpOe+bFWz2xcZ/mvjerOWZtA+NnR9s4RBDGocp9jX/e6sjM6/8yF/UvHrvsq67cXHHyRKYgAMR74A/BsBfX0WEWIPIU2D0A47Jhu4f72Bvn7UFttq0KERvY2PM6DTcSs4l5c1NY4tlymg==; Original-Received: from [2604:4080:1321:8ab0:e47b:cd6c:4bd4:a834] by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1elKcw-0008Gh-9L; Mon, 12 Feb 2018 12:23:02 -0800 In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2600:3c01::f03c:91ff:fedf:adf3 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:222695 Archived-At: On 02/11/2018 11:28 PM, Paul Eggert wrote: > Daniel Colascione wrote: >> I feel like being stuck on C99 and not being able to use C11 would be >> much rarer. Besides: C99 compilers usually supported anonymous structs >> and >> unions as an extension. > > One counterexample is the vendor-supplied compiler on the main server of > our department, which is running Solaris 5.10 (circa 2005). This > compiler is Sun C 5.9 (circa 2009). Although more recent versions of > this compiler do support anonymous structs and unions, bug reports are > still being filed about the feature, e.g., > https://community.oracle.com/thread/4106986 dated December 2017. So I > would say it's still a bit dicey in more-recent versions. That's unfortunate. > If it were really important to require this C11 feature I suppose we > could forge ahead and do it and tell laggards to upgrade their compilers > or use GCC. But my impression is that the feature is mostly just a > nicety, at least for Emacs. If there would be real people adversely impacted by a C11 requirement, we can hold off a little while. The union stuff is merely ugly; it's not a severe problem. I'd definitely like to move to C11 and anonymous inner structures eventually though.