[PATCH] libstdc++: Add more badnames
Jonathan Wakely
jwakely@redhat.com
Thu May 28 12:21:49 GMT 2026
On Thu, 28 May 2026 at 13:15, Jakub Jelinek <jakub@redhat.com> wrote:
>
> On Thu, May 28, 2026 at 06:11:50PM +0800, Zephyr Lykos wrote:
> > libstdc++-v3/ChangeLog:
> >
> > * testsuite/17_intro/badnames.cc: Add Microsoft extensions to the list.
> > * testsuite/17_intro/badnames.cc: Add more BSD extensions.
> > * testsuite/17_intro/badnames.cc: Add extensions from Newlib.
>
> This should have been posted to libstdc++ mailing list.
> WHen you do more changes in one file, all should be listed in the same
> * filename:
> entry.
>
> You need to decide on https://gcc.gnu.org/contribute.html#legal
>
> More importantly, this shouldn't be applied before the actual violations
> of this (i.e. the __in and __out identifiers in libstdc++ headers) are
> renamed to something else.
>
> Has it been actually tested?
I had a similar response in
https://gcc.gnu.org/pipermail/libstdc++/2026-May/066718.html
(I didn't realise it had been posted to libstdc++ and gcc-patches as
separate emails)
>
> > +#define __lzcnt16 __lzcnt16 is a BADNAME
> > +#define __lzcnt64 __lzcnt64 is a BADNAME
> > +#define _mm_cvtsi64x_ss _mm_cvtsi64x_ss is a BADNAME
> > +#define _mm_cvtss_si64x _mm_cvtss_si64x is a BADNAME
> > +#define _mm_cvttss_si64x _mm_cvttss_si64x is a BADNAME
> > +#define _mm_extract_si64 _mm_extract_si64 is a BADNAME
> > +#define _mm_extracti_si64 _mm_extracti_si64 is a BADNAME
> > +#define _mm_insert_si64 _mm_insert_si64 is a BADNAME
> > +#define _mm_inserti_si64 _mm_inserti_si64 is a BADNAME
> > +#define _mm_stream_sd _mm_stream_sd is a BADNAME
> > +#define _mm_stream_si64x _mm_stream_si64x is a BADNAME
> > +#define _mm_stream_ss _mm_stream_ss is a BADNAME
> > +#define __popcnt16 __popcnt16 is a BADNAME
> > +#define __popcnt64 __popcnt64 is a BADNAME
> > +#define __rdtsc __rdtsc is a BADNAME
> > +#define __rdtscp __rdtscp is a BADNAME
>
> At least some of the above are standard x86 intrinsics, defined/used in
> <x86intrin.h> or headers it includes and those are included by libstdc++
> headers, so it is unclear how this can work at all.
>
> Of course, unlike this test, the plugin will probably be ok, one can use
> __lzcnt16 or _mm_cvtss_si64x etc. in the headers, but one shouldn't name
> function/template arguments, automatic variables etc. like that.
>
> Jakub
>
More information about the Libstdc++
mailing list