This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v2 4/6] compiler-gcc.h: add asm_inline definition
- From: Miguel Ojeda <miguel dot ojeda dot sandonis at gmail dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: Rasmus Villemoes <linux at rasmusvillemoes dot dk>, Nick Desaulniers <ndesaulniers at google dot com>, "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86 at kernel dot org>, LKML <linux-kernel at vger dot kernel dot org>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 5 Sep 2019 17:52:44 +0200
- Subject: Re: [PATCH v2 4/6] compiler-gcc.h: add asm_inline definition
- References: <20190829083233.24162-1-linux@rasmusvillemoes.dk> <20190830231527.22304-1-linux@rasmusvillemoes.dk> <20190830231527.22304-5-linux@rasmusvillemoes.dk> <CAKwvOdktYpMH8WnEQwNE2JJdKn4w0CHv3L=YHkqU2JzQ6Qwkew@mail.gmail.com> <a5085133-33da-6c13-6953-d18cbc6ad3f5@rasmusvillemoes.dk> <20190905134535.GP9749@gate.crashing.org>
On Thu, Sep 5, 2019 at 3:45 PM Segher Boessenkool
<segher@kernel.crashing.org> wrote:
>
> [ That's not what a feature test macro is; a feature test macro allows the
> user to select some optional behaviour. Things like _GNU_SOURCE. ]
Yes and no. GNU libc defines feature test macros like you say, but
C++'s feature macros are like Rasmus/Nick are saying. I think libc's
definition is weird, I would call those "feature selection macros"
instead, because the user is selecting between some features (whether
to enable or not, for instance), rather than testing for the features.
> Why would GCC want to have macros for all features it has? That would be
> quite a few new ones every release.
Maybe GCC wouldn't, but its users, they surely would. For anything
that 1) is a new language feature, 2) breaks backwards-compatibility
with previous (or other compilers) and 3) is expected to be used by
end users, yes, it would be very useful to have.
For the same reasons C++ is adding feature test macros all over the
place nowadays and it is considered good practice (see SD-6: SG10
Feature Test Recommendations).
Cheers,
Miguel