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

* Re: [PATCH users/roland/safe-ctype] Uniformly put `#include "safe-ctype.h"` last among #include directives
  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
  1 sibling, 0 replies; 5+ messages in thread
From: Alan Modra @ 2023-04-24  3:03 UTC (permalink / raw)
  To: Roland McGrath; +Cc: Binutils, GDB

On Sun, Apr 23, 2023 at 05:55:02PM -0700, Roland McGrath via Binutils wrote:
> 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?

OK for binutils.

-- 
Alan Modra
Australia Development Lab, IBM

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

* Re: [PATCH users/roland/safe-ctype] Uniformly put `#include "safe-ctype.h"` last among #include directives
  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
  1 sibling, 1 reply; 5+ messages in thread
From: Tom Tromey @ 2023-04-24 17:21 UTC (permalink / raw)
  To: Roland McGrath via Gdb-patches; +Cc: Binutils, Roland McGrath

>>>>> "Roland" == Roland McGrath via Gdb-patches <gdb-patches@sourceware.org> writes:

Roland> I didn't touch anything in the libiberty subdirectory since AIUI
Roland> that's still copied from the gcc repository.

There's also this patch to fix it differently:

https://sourceware.org/pipermail/gdb-patches/2023-April/198954.html

which isolates the damage to gdb.

Tom

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

* Re: [PATCH users/roland/safe-ctype] Uniformly put `#include "safe-ctype.h"` last among #include directives
  2023-04-24 17:21 ` Tom Tromey
@ 2023-04-24 17:40   ` Roland McGrath
  2023-04-29  7:36     ` Roland McGrath
  0 siblings, 1 reply; 5+ messages in thread
From: Roland McGrath @ 2023-04-24 17:40 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Roland McGrath via Gdb-patches, Binutils

[-- Attachment #1: Type: text/plain, Size: 623 bytes --]

That seems easier to maintain without breakage over the long term than my
version. Can we get that landed forthwith?

Thanks,
Roland


On Mon, Apr 24, 2023 at 10:21 AM Tom Tromey <tom@tromey.com> wrote:

> >>>>> "Roland" == Roland McGrath via Gdb-patches <
> gdb-patches@sourceware.org> writes:
>
> Roland> I didn't touch anything in the libiberty subdirectory since AIUI
> Roland> that's still copied from the gcc repository.
>
> There's also this patch to fix it differently:
>
> https://sourceware.org/pipermail/gdb-patches/2023-April/198954.html
>
> which isolates the damage to gdb.
>
> Tom
>

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

* Re: [PATCH users/roland/safe-ctype] Uniformly put `#include "safe-ctype.h"` last among #include directives
  2023-04-24 17:40   ` Roland McGrath
@ 2023-04-29  7:36     ` Roland McGrath
  0 siblings, 0 replies; 5+ messages in thread
From: Roland McGrath @ 2023-04-29  7:36 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Roland McGrath via Gdb-patches, Binutils, Manoj Gupta

[-- Attachment #1: Type: text/plain, Size: 884 bytes --]

Since his v3 seems to address all your feedback and seems like a clear fix
(WFM), I've committed to trunk on Manoj's behalf.

Thanks,
Roland

On Mon, Apr 24, 2023 at 10:40 AM Roland McGrath <mcgrathr@google.com> wrote:

> That seems easier to maintain without breakage over the long term than my
> version. Can we get that landed forthwith?
>
> Thanks,
> Roland
>
>
> On Mon, Apr 24, 2023 at 10:21 AM Tom Tromey <tom@tromey.com> wrote:
>
>> >>>>> "Roland" == Roland McGrath via Gdb-patches <
>> gdb-patches@sourceware.org> writes:
>>
>> Roland> I didn't touch anything in the libiberty subdirectory since AIUI
>> Roland> that's still copied from the gcc repository.
>>
>> There's also this patch to fix it differently:
>>
>> https://sourceware.org/pipermail/gdb-patches/2023-April/198954.html
>>
>> which isolates the damage to gdb.
>>
>> Tom
>>
>

^ 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).