]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/symtab.c
gdb: Fix building with clang
authorJens Remus <jremus@linux.ibm.com>
Mon, 5 Feb 2024 16:50:05 +0000 (17:50 +0100)
committerAndreas Arnez <arnez@linux.ibm.com>
Thu, 8 Feb 2024 13:21:01 +0000 (14:21 +0100)
commit51d525db2edce2708d85c4ff63e82269bbe0f3fc
tree1d8adf4b9bcde152a3be23002b276b6bd320c93c
parent5bc71c2a6b8efb27089baa1fecded82be4f550a7
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>
gdb/symtab.c