From: Jens Remus Date: Mon, 5 Feb 2024 16:50:05 +0000 (+0100) Subject: gdb: Fix building with clang X-Git-Tag: gdb-15-branchpoint~1034 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=51d525db2edce2708d85c4ff63e82269bbe0f3fc;p=thirdparty%2Fbinutils-gdb.git 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 --- diff --git a/gdb/symtab.c b/gdb/symtab.c index 32b19e6c902..02f5d4f1b3d 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