[Bug libstdc++/97088] 17_intro/names.cc and experimental/names.cc fail with --disable-libstdcxx-pch

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Sep 20 20:06:42 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97088

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Christophe Lyon from comment #2)
> OK, so you mean that prototypes like
> extern int __isinff (float x);
> should not name their parameters? I can certainly submit the simple patch to
> newlib.

The parameter should use a reserved name, e.g. __x.

This is a valid C program which will presumably fail to compile with newlib:

#define x 1234
#include <math.h>
int main() { return 0; }

The point of the test is to ensure that libstdc++ headers don't use
non-reserved names like 'x'. In this case it's found a newlib bug, not a
libstdc++ one.

The glibc case is a bit more complicated. 'j' is not a reserved name, but (at
least on x86) the __libc_fpstate types do use reserved names unless __USE_MISC
is defined. In strict modes a reserved name like __j will be used intead. Maybe
the test needs to account for that.


More information about the Gcc-bugs mailing list