Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1763256ybe; Sat, 7 Sep 2019 02:23:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzJd7ErKfaPYoQ70TBuZcILRW/OUWz7ckz392COVE76ah4t9RpCvOSF3SGi2n6ezAjdcr+l X-Received: by 2002:a17:90a:8911:: with SMTP id u17mr14750950pjn.128.1567848224445; Sat, 07 Sep 2019 02:23:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567848224; cv=none; d=google.com; s=arc-20160816; b=X5vh0m28MFLrew0kgEtAAVuOqc4g4MsXVdKDtDCKcrdhvkx+vi1ZvyXr1alraiXBBI ii2NkDLKwHUnf9Ld4ONbV9Fg4koGF2oEygJl1DdreODOuFBwplpMvQe2zf+wEg8VN8CS stPyMSM8ur/OE/0okuVHHZipnMaij1P8qrr7HMGsKw0zqTB0oaHzrPyKoesUz2a2XBa3 U1RoUD/VmaiTJ2LI5jmvKbw2BB1D5TZA5rR9Nev1MeyI94NqltsFKvlOseEVCiBN8UAq WmcuovH0tRiluFzU+x1WmLWjmy2HsPgjUrHq2sgXWHZboKzt+mOJ2J7biJYcT0hAdBQa 9FBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=VHvbSmOVlEeRO3F0FgBrZlRuAxZf9TwWlc3hcA9prZc=; b=rjERTmuZLpXSSRONJtFpoHnfJgXE7XW9UKuuEFZ7fvrrm22BAxhN9wWWO2/mPItzWx f/mgFBBdukGvB3rL2cdpLeDFdM6SW9FM/C/XoTOCRUXQsBbeaSQeUIKQf3OtDt2QOB0V Twj87SAo+TvUqx5jwJX02QrUzgN3QrmaO051di+NyEo4Ro1B+F1ldCqf8KB+HtdSKkP4 1kdrdv1RzUAko+xGyXt8UpbTFiHg/HqyAnlVQstqBi2Tb6NErj96kkbuubumzOQudwba X7ri4+WbYEZpLMe1waZ/ZC7jmiKD4FA/M8HXfQIKvfqZO3+7CkiptXS2D8PdkhrRiywv wxmA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x188si8676149pfd.55.2019.09.07.02.23.29; Sat, 07 Sep 2019 02:23:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390285AbfIFQao (ORCPT + 99 others); Fri, 6 Sep 2019 12:30:44 -0400 Received: from gate.crashing.org ([63.228.1.57]:56683 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726810AbfIFQan (ORCPT ); Fri, 6 Sep 2019 12:30:43 -0400 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x86GUT4l007488; Fri, 6 Sep 2019 11:30:29 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id x86GUSDf007487; Fri, 6 Sep 2019 11:30:28 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Fri, 6 Sep 2019 11:30:28 -0500 From: Segher Boessenkool To: Miguel Ojeda Cc: Rasmus Villemoes , Nick Desaulniers , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , LKML , "gcc-patches@gcc.gnu.org" Subject: Re: [PATCH v2 4/6] compiler-gcc.h: add asm_inline definition Message-ID: <20190906163028.GC9749@gate.crashing.org> References: <20190829083233.24162-1-linux@rasmusvillemoes.dk> <20190830231527.22304-1-linux@rasmusvillemoes.dk> <20190830231527.22304-5-linux@rasmusvillemoes.dk> <20190905134535.GP9749@gate.crashing.org> <20190906122349.GZ9749@gate.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 06, 2019 at 05:13:54PM +0200, Miguel Ojeda wrote: > On Fri, Sep 6, 2019 at 2:23 PM Segher Boessenkool > wrote: > > I can't find anything with "feature" and "macros" in the C++ standard, > > it's "predefined macros" there I guess? In C, it is also "predefined > > macros" in general, and there is "conditional feature macros". > > They are introduced in C++20, (Which isn't the C++ standard yet, okay). > but they have been added for a lot of > older features in both the language (see [cpp.predefined]p1, around 50 > of them) and the library (see [support.limits.general]p3, ~100): > > http://eel.is/c++draft/cpp.predefined#tab:cpp.predefined.ft > http://eel.is/c++draft/support.limits#tab:support.ft And they spell it "feature-test" there. Lovely :-/ > > Sure. But the name is traditional, many decades old, it predates glibc. > > Using an established name to mean pretty much the opposite of what it > > normally does is a bit confusing, never mind if that usage makes much > > sense ;-) > > Agreed on principle :-) However, I wouldn't say it is the opposite. I > would say they are the same, but from different perspectives: one says > "I want to test if the user enabled the feature", the other says "I > want to test if the vendor implemented the feature". No, that is not what it does. A user defines such a macro, and that makes the library change behaviour. As the GNU C Library manual explains: This system exists to allow the library to conform to multiple standards. Although the different standards are often described as supersets of each other, they are usually incompatible because larger standards require functions with names that smaller ones reserve to the user program. This is not mere pedantry -- it has been a problem in practice. For instance, some non-GNU programs define functions named 'getline' that have nothing to do with this library's 'getline'. They would not be compilable if all features were enabled indiscriminately. https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html Segher