From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Oleh Krehel Newsgroups: gmane.emacs.devel Subject: Re: Is INLINE_HEADER_BEGIN still useful? Date: Wed, 29 Apr 2015 16:12:13 +0200 Message-ID: <87r3r3nhvm.fsf@gmail.com> References: <87h9rzb2nc.fsf@gmail.com> <5540E3E2.4030701@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1430317105 24140 80.91.229.3 (29 Apr 2015 14:18:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Apr 2015 14:18:25 +0000 (UTC) Cc: emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 29 16:18:24 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 1YnSoi-0004hL-7P for ged-emacs-devel@m.gmane.org; Wed, 29 Apr 2015 16:18:24 +0200 Original-Received: from localhost ([::1]:39310 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnSoh-000089-GB for ged-emacs-devel@m.gmane.org; Wed, 29 Apr 2015 10:18:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49133) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnSoY-00006y-UW for emacs-devel@gnu.org; Wed, 29 Apr 2015 10:18:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnSoS-0007Lj-QC for emacs-devel@gnu.org; Wed, 29 Apr 2015 10:18:14 -0400 Original-Received: from mail-wg0-x230.google.com ([2a00:1450:400c:c00::230]:34065) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnSoS-0007Kn-Jn for emacs-devel@gnu.org; Wed, 29 Apr 2015 10:18:08 -0400 Original-Received: by wgso17 with SMTP id o17so30015562wgs.1 for ; Wed, 29 Apr 2015 07:18:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=gw5UoIJaXEZvGtUCeiZDdaND03MUPLlmRor/yer3KGI=; b=NLnD/Itx0D+KQkn+MTAyyJBkmLiYjNQJR2fM76B4sGS8hmdk1QhF4E2UFsh5EAsw7m AXNdGwoFq1c+T3CVKpqZp6qrdGj844kXdtAbyLSJ9FKr8H64/e5r/9pEm8r3hWEa3dJq T1L7j1jkz830ZjiYpLW4dk0VeksVHZef/Ay67Mv8C+r5jC3cpm/rhjvnQfVWo2g/Jj0d 5/YEP+ADjBUfktRlt6prcfAboQht1oXL4kEylq7rKcyfV2m3j351t12QU3/JK0S4Pq+n aHledMt4Qd9Cgl+HkA6xuxC8tEPGCoNMPTmNFC3f/A9yfK6i2UEpDJiqDuGmKr644g6W 6RyQ== X-Received: by 10.180.102.228 with SMTP id fr4mr6205918wib.4.1430317087581; Wed, 29 Apr 2015 07:18:07 -0700 (PDT) Original-Received: from firefly (dyn069045.nbw.tue.nl. [131.155.69.45]) by mx.google.com with ESMTPSA id es5sm39220343wjc.30.2015.04.29.07.18.06 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 29 Apr 2015 07:18:06 -0700 (PDT) In-Reply-To: <5540E3E2.4030701@cs.ucla.edu> (Paul Eggert's message of "Wed, 29 Apr 2015 07:00:02 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::230 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:186015 Archived-At: Paul Eggert writes: > 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.) Thanks for the tip. >> 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.) I don't see how 54133 can be related to anything with the "inline" declaration. And 63877 is just a bogus warning for a specific case, not a big deal. I got no warnings when I tested my buffer.h patch. > 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. I'm getting no problems so far with my default 4.8.2. I can try to patch the whole thing, not just buffer.h. Unless it's useless, because 4.8.2 is considered too new. >> 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. Thanks for the comments, they're very helpful. Maybe someone on the list could respond if they use a compiler that doesn't support the C99 "inline" declaration? Oleh