diff options
author | Jens Remus <jremus@linux.ibm.com> | 2024-02-05 17:50:05 +0100 |
---|---|---|
committer | Andreas Arnez <arnez@linux.ibm.com> | 2024-02-08 14:21:01 +0100 |
commit | 51d525db2edce2708d85c4ff63e82269bbe0f3fc (patch) | |
tree | 1d8adf4b9bcde152a3be23002b276b6bd320c93c /gdb/symtab.c | |
parent | 5bc71c2a6b8efb27089baa1fecded82be4f550a7 (diff) | |
download | binutils-51d525db2edce2708d85c4ff63e82269bbe0f3fc.zip binutils-51d525db2edce2708d85c4ff63e82269bbe0f3fc.tar.gz binutils-51d525db2edce2708d85c4ff63e82269bbe0f3fc.tar.bz2 |
gdb: Fix building with clang
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>
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r-- | gdb/symtab.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c index 32b19e6..02f5d4f 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 |