[PR,gdb/31328] gdb: Fix building with clang
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_build--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 |
success
|
Testing passed
|
Commit Message
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(-)
Comments
>>>>> 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
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
@@ -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