From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: Is INLINE_HEADER_BEGIN still useful? Date: Wed, 29 Apr 2015 07:00:02 -0700 Organization: UCLA Computer Science Department Message-ID: <5540E3E2.4030701@cs.ucla.edu> References: <87h9rzb2nc.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1430316040 4933 80.91.229.3 (29 Apr 2015 14:00:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Apr 2015 14:00:40 +0000 (UTC) To: Oleh Krehel , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 29 16:00:32 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YnSXK-0001D4-Cc for ged-emacs-devel@m.gmane.org; Wed, 29 Apr 2015 16:00:26 +0200 Original-Received: from localhost ([::1]:39247 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnSXJ-0003NM-UV for ged-emacs-devel@m.gmane.org; Wed, 29 Apr 2015 10:00:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnSXA-0003Mt-5g for emacs-devel@gnu.org; Wed, 29 Apr 2015 10:00:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnSX5-0001Bz-3a for emacs-devel@gnu.org; Wed, 29 Apr 2015 10:00:16 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:39792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnSX4-0001BW-Ru for emacs-devel@gnu.org; Wed, 29 Apr 2015 10:00:11 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 96314A60002; Wed, 29 Apr 2015 07:00:08 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J8zWcMVpw7zx; Wed, 29 Apr 2015 07:00:08 -0700 (PDT) Original-Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id EC2ADA6000D; Wed, 29 Apr 2015 07:00:07 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 In-Reply-To: <87h9rzb2nc.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 131.179.128.62 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:186014 Archived-At: Oleh Krehel wrote: > This macro, encountered in most headers, seems to work around some > compilers not supporting C99. A quick internet search shows that no > other software except Emacs uses this (any more, I assume some did in > the past). INLINE_HEADER_BEGIN is defined in src/conf_post.h. The command "git blame src/conf_post.h" shows it was added in 2012, so it's not that old. (For software archaeology questions like this, "git blame" Is Your Friend.) > Is it still useful? It's defined in terms of _GL_INLINE_HEADER_BEGIN. The comment for the definition of _GL_INLINE_HEADER_BEGIN says it's a workaround for GCC bugs 54133 (fixed in December 2013 on the GCC trunk) and 63877 (fixed November 2014). So I guess these macros are useful until we can assume that everybody is building Emacs with GCC 5.1.0 or later. (Though someone should test this guess.) If my guess is right, then given the slow pace at which GCC gets out into the field, we'll need this macro for another decade or two. > Is C11 encouraged / allowed / discouraged / disallowed? > > I assume that C99 is at least allowed since #17487. Is it encouraged? It depends on what C99 features you're talking about. Emacs can use ordinary C99 features such as declaration after statements and variadic macros. The Emacs source does not assume conformance to C99 in every detail, as not every implementation supports every C99 feature (even GCC doesn't do that). Although C11 features can be used on systems where they're known to work, Emacs needs to be portable to pre-C11 systems, as people still regularly build Emacs with GCC 3.x. For example, the Emacs source uses the 'alignof' syntax of C11, but Emacs supplies its own implementation of 'alignof' on pre-C11 systems that lack it. There are also some style issues. The Emacs comment style prefers commenting /* like this */, not // like this (introduced in C99). The Emacs source code does not ever use trigraphs, even though C99 allows them. That sort of thing.