This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Use __builtin_tgmath in tgmath.h with GCC 8 (bug 21660) [committed]
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: Florian Weimer <fweimer at redhat dot com>, Joseph Myers <joseph at codesourcery dot com>, libc-alpha at sourceware dot org
- Cc: nd at arm dot com
- Date: Fri, 17 Nov 2017 13:00:08 +0000
- Subject: Re: Use __builtin_tgmath in tgmath.h with GCC 8 (bug 21660) [committed]
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs dot Nagy at arm dot com;
- Nodisclaimer: True
- References: <alpine.DEB.2.20.1711150209170.16320@digraph.polyomino.org.uk> <5A0ED1F5.7030906@arm.com> <e37fbc8e-0c07-ec7c-8b2d-7d881f300a48@redhat.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On 17/11/17 12:50, Florian Weimer wrote:
> On 11/17/2017 01:11 PM, Szabolcs Nagy wrote:
>>> +/* There are two variant implementations of type-generic macros in
>>> + this file: one for GCC 8 and later, using __builtin_tgmath and
>>> + where each macro expands each of its arguments only once, and one
>>> + for older GCC, using other compiler extensions but with macros
>>> + expanding their arguments many times (so resulting in exponential
>>> + blowup of the size of expansions when calls to such macros are
>>> + nested inside arguments to such macros). */
>>> +
>>> +#define __HAVE_BUILTIN_TGMATH __GNUC_PREREQ (8, 0)
>>
>> this breaks the build on trunk toolchains that
>> lack __builtin_tgmath
>
> Short of getting GCC to adopt something similar to the Clang __has_builtin pseudo-macro, I don't see any
> solution other that requiring those who are affected by such issues to update.
>
> Considering that this only affects an unreleased toolchain, I don't think the upgrade requirement is
> unreasonably onerous.
>
in this case prereq(8,1) would work
(the strncpy diagnostic suppression pragma thing is more complicated
because some gcc-8.0 require it others fail with it, but in general
i prefer to be able to use the same gcc build for a while and also
for bisecting issues.)