[PATCH 2/2] ctype: use less short names in public header
Wed Nov 24 04:15:31 GMT 2021
On 23 Nov 2021 15:09, Richard Earnshaw wrote:
> This is wrong and breaks all old versions of C++.
this is a bit vague. it would help if you provided details as to what broke.
i doubt this broke all old versions of C++ everywhere.
i'm guessing you're referring to the GNU C++ (libstdc++) library specifically
and its hardcoding of newlib's internal ctype define names.
if you're talking about something else, please state so clearly.
> The GNU sim code should not be using reserved names (those starting _)
> in normal source code. Such names are reserved to the implementation.
that's not really a good reason to go pooping all over the namespace.
we can maintain backwards compat here for C++ code fairly easily:
@@ -71,6 +71,16 @@ enum
/* For C++ backward-compatibility only. */
extern __IMPORT const char _ctype_;
+# define _U _ISupper
+# define _L _ISlower
+# define _N _ISdigit
+# define _S _ISspace
+# define _P _ISpunct
+# define _C _IScntrl
+# define _X _ISxdigit
+# define _B _ISblank
const char *__locale_ctype_ptr (void);
considering the numerical value is part of the ABI, not the name, libstdc++
could have inlined the constant values instead. i wonder how long of a version
skew is reasonable if we wanted to transition it to the new names to match what
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: not available
More information about the Newlib