public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH users/roland/safe-ctype] Uniformly put `#include "safe-ctype.h"` last among #include directives
@ 2023-04-24  0:55 Roland McGrath
  2023-04-24  3:03 ` Alan Modra
  2023-04-24 17:21 ` Tom Tromey
  0 siblings, 2 replies; 5+ messages in thread
From: Roland McGrath @ 2023-04-24  0:55 UTC (permalink / raw)
  To: Binutils, GDB

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-04-29  7:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-24  0:55 [PATCH users/roland/safe-ctype] Uniformly put `#include "safe-ctype.h"` last among #include directives Roland McGrath
2023-04-24  3:03 ` Alan Modra
2023-04-24 17:21 ` Tom Tromey
2023-04-24 17:40   ` Roland McGrath
2023-04-29  7:36     ` Roland McGrath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).