Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Remove #ifdef from cooked-index-entry.c
@ 2026-10-28 17:23 Tom Tromey
  2026-10-28 17:33 ` Simon Marchi
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2026-10-28 17:23 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

cooked-index-entry.c has an #ifdef to work around a GCC 7.5.0 bug.
However, the workaround just removes a 'constexpr' which is not
needed.  The constexpr behavior was desirable in the past, but this
changed with commit 8cbf7d2a ("gdb/dwarf: remove unnecessary
comparison in cooked_index_entry::compare").

This removes the #ifdef and the constexpr.
---
 gdb/dwarf2/cooked-index-entry.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/gdb/dwarf2/cooked-index-entry.c b/gdb/dwarf2/cooked-index-entry.c
index 44b065157b8..c76c263117a 100644
--- a/gdb/dwarf2/cooked-index-entry.c
+++ b/gdb/dwarf2/cooked-index-entry.c
@@ -47,12 +47,7 @@ int
 cooked_index_entry::compare (const char *stra, const char *strb,
 			     comparison_mode mode)
 {
-#if defined (__GNUC__) && !defined (__clang__) && __GNUC__ <= 7
-  /* Work around error with gcc 7.5.0.  */
   auto munge = [] (char c) -> unsigned char
-#else
-  auto munge = [] (char c) constexpr -> unsigned char
-#endif
     {
       /* Treat '<' as if it ended the string.  This lets something
 	 like "func<t>" match "func<t<int>>".  See the "Breakpoints in

base-commit: aeed64b39aed57729f66ad51560d8964e8201e6e
-- 
2.56.0


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

* Re: [PATCH] Remove #ifdef from cooked-index-entry.c
  2026-10-28 17:23 [PATCH] Remove #ifdef from cooked-index-entry.c Tom Tromey
@ 2026-10-28 17:33 ` Simon Marchi
  2026-10-28 21:23   ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Marchi @ 2026-10-28 17:33 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches

On 10/28/26 1:23 PM, Tom Tromey wrote:
> cooked-index-entry.c has an #ifdef to work around a GCC 7.5.0 bug.
> However, the workaround just removes a 'constexpr' which is not
> needed.  The constexpr behavior was desirable in the past, but this
> changed with commit 8cbf7d2a ("gdb/dwarf: remove unnecessary
> comparison in cooked_index_entry::compare").
> 
> This removes the #ifdef and the constexpr.

Nit: it's an #if, not an #ifdef.

For my curiosity, can you explain why constexpr was needed (or useful) in the first place?

The commit that added it is:

https://gitlab.com/gnutools/binutils-gdb/-/commit/2e724489260d02a528591eaea4710ce5aeeee0e8

but it doesn't talk about that.

Approved-By: Simon Marchi <simon.marchi@efficios.com>

Thanks,

Simon

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

* Re: [PATCH] Remove #ifdef from cooked-index-entry.c
  2026-10-28 17:33 ` Simon Marchi
@ 2026-10-28 21:23   ` Tom Tromey
  0 siblings, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2026-10-28 21:23 UTC (permalink / raw)
  To: Simon Marchi; +Cc: Tom Tromey, gdb-patches

Simon> For my curiosity, can you explain why constexpr was needed (or
Simon> useful) in the first place?

I added a note to the commit message but basically:

Simon> The commit that added it is:
Simon> https://gitlab.com/gnutools/binutils-gdb/-/commit/2e724489260d02a528591eaea4710ce5aeeee0e8
Simon> but it doesn't talk about that.

... the old code called "munge ('<')" which is a constant.
Though perhaps that was wishful thinking and/or maybe an older patch did
something else.

Tom

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

end of thread, other threads:[~2026-10-28 21:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-28 17:23 [PATCH] Remove #ifdef from cooked-index-entry.c Tom Tromey
2026-10-28 17:33 ` Simon Marchi
2026-10-28 21:23   ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox