* [PATCH] [PR gdb/31328] gdb: Fix building with clang
@ 2024-02-05 16:50 Jens Remus
2024-02-05 17:50 ` Tom Tromey
0 siblings, 1 reply; 3+ messages in thread
From: Jens Remus @ 2024-02-05 16:50 UTC (permalink / raw)
To: gdb-patches, tromey; +Cc: Jens Remus, Andreas Arnez
This resolves the following clang++ error message:
../../gdb/symtab.c:4892:33: error: logical not is only applied to the left hand side of this comparison [-Werror,-Wlogical-not-parentheses]
if (preg.has_value () && !preg->exec (sym->natural_name (), 0,
^
../../gdb/symtab.c:4892:33: note: add parentheses after the '!' to evaluate the comparison first
if (preg.has_value () && !preg->exec (sym->natural_name (), 0,
^
(
../../gdb/symtab.c:4892:33: note: add parentheses around left hand side expression to silence this warning
if (preg.has_value () && !preg->exec (sym->natural_name (), 0,
^
(
Bug: https://sourceware.org/PR31328
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
---
gdb/symtab.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 32b19e6c9023..02f5d4f1b3d1 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -4889,8 +4889,8 @@ global_symbol_searcher::add_matching_symbols
if (!sym->matches (kind))
continue;
- if (preg.has_value () && !preg->exec (sym->natural_name (), 0,
- nullptr, 0) == 0)
+ if (preg.has_value () && preg->exec (sym->natural_name (), 0,
+ nullptr, 0) != 0)
continue;
if (((sym->domain () == VAR_DOMAIN
--
2.40.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] [PR gdb/31328] gdb: Fix building with clang
2024-02-05 16:50 [PATCH] [PR gdb/31328] gdb: Fix building with clang Jens Remus
@ 2024-02-05 17:50 ` Tom Tromey
2024-02-08 13:23 ` Andreas Arnez
0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2024-02-05 17:50 UTC (permalink / raw)
To: Jens Remus; +Cc: gdb-patches, tromey, Andreas Arnez
>>>>> Jens Remus <jremus@linux.ibm.com> writes:
> This resolves the following clang++ error message:
[...]
Thank you. This is ok.
Approved-By: Tom Tromey <tom@tromey.com>
Tom
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] [PR gdb/31328] gdb: Fix building with clang
2024-02-05 17:50 ` Tom Tromey
@ 2024-02-08 13:23 ` Andreas Arnez
0 siblings, 0 replies; 3+ messages in thread
From: Andreas Arnez @ 2024-02-08 13:23 UTC (permalink / raw)
To: Tom Tromey; +Cc: Jens Remus, gdb-patches, tromey
On Mon, Feb 05 2024, Tom Tromey wrote:
>>>>>> Jens Remus <jremus@linux.ibm.com> writes:
>
>> This resolves the following clang++ error message:
> [...]
>
> Thank you. This is ok.
> Approved-By: Tom Tromey <tom@tromey.com>
>
> Tom
Thanks, pushed.
--
Andreas
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-02-08 13:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-05 16:50 [PATCH] [PR gdb/31328] gdb: Fix building with clang Jens Remus
2024-02-05 17:50 ` Tom Tromey
2024-02-08 13:23 ` Andreas Arnez
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).