Fix -Wlogical-not-parentheses warning from Apple clang 13.0.0

Message ID 20240206182313.23855-1-ciaranwoodward@xmos.com
State Dropped
Headers
Series Fix -Wlogical-not-parentheses warning from Apple clang 13.0.0 |

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

Ciaran Woodward Feb. 6, 2024, 6:23 p.m. UTC
  ---
 gdb/symtab.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Tom Tromey Feb. 6, 2024, 6:38 p.m. UTC | #1
>>>>> "Ciaran" == Ciaran Woodward <ciaranwoodward@xmos.com> writes:

Ciaran> ---
Ciaran>  gdb/symtab.c | 4 ++--
Ciaran>  1 file changed, 2 insertions(+), 2 deletions(-)

Patches should have some text here.

I approved a similar patch very recently, I don't know if it was checked
in or not though.

Tom
  
Ciaran Woodward Feb. 7, 2024, 11:20 a.m. UTC | #2
> Patches should have some text here.

Thanks, noted - I'll do this in future.

> I approved a similar patch very recently, I don't know if it was checked
> in or not though.

Yes, I see it here (identical change, actually!) but it has not been pushed.
https://patchwork.sourceware.org/project/gdb/patch/20240205165005.3861316-1-jremus@linux.ibm.com/

May as well move ahead with that one and ignore my patch.

(what's the etiquette for pushing other people's patches?)

Cheers,
Ciaran
  
Tom Tromey Feb. 7, 2024, 3:46 p.m. UTC | #3
>>>>> "Ciaran" == Ciaran Woodward <ciaranwoodward@xmos.com> writes:

Ciaran> (what's the etiquette for pushing other people's patches?)

I am not sure we've ever really discussed it.

I sometimes do it if the patch meets all the criteria (including the
copyright stuff) and if I think the author can't for some reason.  In
this case, I see other patches from that author in the repository,
though.

Tom
  

Patch

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