[PATCH users/roland/safe-ctype] Uniformly put `#include "safe-ctype.h"` last among #include directives
Roland McGrath
mcgrathr@google.com
Mon Apr 24 00:55:02 GMT 2023
The libc++ headers changed recently such that some standard C++
headers that didn't used
to lead to using <ctype.h> and its symbols now do so.
This ran afoul of the shenanigans in "safe-ctype.h" in at least one
place where that header
is included before a standard header.
This only broke things that I saw in gdb/minsyms.c, but the same
problem may well arise
in the future with other headers. This sort of redefinition of
standard symbols is definitely not
kosher under the C and C++ standards at all. In the long run we
should consider ways to solve
the problem "safe-ctype.h" exists to solve without violating the
language standards in this way.
To make the code more future-proof while we're still doing this, I
changed all the uses
uniformly throughout the repo to just put #include "safe-ctype.h"
last, with a comment
reminding folks not to change that ordering (and a comment in
safe-ctype.h about that).
I didn't touch anything in the libiberty subdirectory since AIUI
that's still copied from
the gcc repository.
The changes are on the users/roland/safe-ctype branch on sourceware. My mailer
makes it difficult to paste a large patch like this into the message
without mangling
it. It's very mechanical and I figure everyone actively concerned can
look at the git
branch on sourceware easily enough for themselves.
OK for trunk?
Thanks,
Roland
More information about the Binutils
mailing list