Re: [PATCH v2 4/6] compiler-gcc.h: add asm_inline definition
From: Segher Boessenkool
Date: Thu Sep 05 2019 - 09:45:49 EST
Hi Rasmus,
On Thu, Sep 05, 2019 at 01:07:11PM +0200, Rasmus Villemoes wrote:
> On 05/09/2019 02.18, Nick Desaulniers wrote:
> > Is it too late to ask for a feature test macro? Maybe one already
> > exists?
>
> No, not as far as I know.
[ 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. ]
> Perhaps something like below, though that
> won't affect the already released gcc 9.1 and 9.2, of course.
That is one reason to not want such a predefined macro. Another reason
is that you usually need to compile some test programs *anyway*, to see if
some bug is present for example, or to see if the exact implementation of
the feature is beneficial (or harmful) to your program in some way.
> gcc maintainers, WDYT? Can we add a feature test macro for asm inline()?
The only comparable existing predefined macro is __PRAGMA_REDEFINE_EXTNAME
it seems (no, I have no idea either). Everything else is required by some
standard (a "standard standard" or a "vendor standard", I'm lumping
everything together here), or shows whether some target has some feature,
or how many bits there are in certain types, that kind of thing.
Why would GCC want to have macros for all features it has? That would be
quite a few new ones every release. And what about bug fixes, are bug
fixes features as well?
I think you need to solve your configuration problems in your
configuration system.
Segher