[patch] rename local _C2 identifiers in stl map header files

Olivier Hainque hainque@adacore.com
Thu Jan 9 13:12:00 GMT 2020


The attached patch is a proposal to simply rename a template
type name in stl_map.h and stl_multimap.h in order to prevent
clashes with a macro name exposed by a system header on VxWorks.

The conflicting name is _C2, which in principle is "reserved"
for the system so having such a macro exposed by a system header
doesn't seem to be a bug per se.

I suppose that the libstdc++ headers can be considered part of
the system as well in a way, so it's not really a bug there either.

Fixing the OS headers is a major hassle on VxWorks, however,
especially with more recent versions of the system, so we arranged
not to rely on it at all up to now and a straightforward adjustment
in the libstdc++ headers offers a way smoother and simpler way

I'm not sure what "C2" was intended to refer to so I picked
an alternate name which seemed to match some aspects of the context
while keeping the very-short-identifier style used throughout.

This cures a lot of test failures with our gcc-9 based
toolchains for VwWorks 7 and applies cleanly on mainline.

I'm running a bootstrap & regression test cycle on x86_64-linux

Would this be OK to commit ?

Thanks in advance for your feedback,


2020-01-09  Olivier Hainque  <hainque@adacore.com>

	* include/bits/stl_map.h: Rename _C2 template typenames	as _Mt.
	* include/bits/stl_multimap.h: Likewise.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-Rename-local-_C2-identifiers-in-stl-map-header-files.patch.txt
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20200109/44f80ddd/attachment.txt>

More information about the Libstdc++ mailing list