public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/31328] New: gdb fails to compile with clang due to missing parentheses
@ 2024-02-02 14:30 jremus at linux dot ibm.com
  2024-02-02 14:33 ` [Bug gdb/31328] " jremus at linux dot ibm.com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jremus at linux dot ibm.com @ 2024-02-02 14:30 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31328

            Bug ID: 31328
           Summary: gdb fails to compile with clang due to missing
                    parentheses
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: jremus at linux dot ibm.com
  Target Milestone: ---

Created attachment 15349
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15349&action=edit
Patch that should resolve the issue

gdb fails to compile with clang 16.0.6 on s390x with the following error
message, that I assume not to be architecture specific:

../../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,
                                       ^
                                       (

Attached is a patch with what I assume to be the fix.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug gdb/31328] gdb fails to compile with clang due to missing parentheses
  2024-02-02 14:30 [Bug gdb/31328] New: gdb fails to compile with clang due to missing parentheses jremus at linux dot ibm.com
@ 2024-02-02 14:33 ` jremus at linux dot ibm.com
  2024-02-02 15:12 ` tromey at sourceware dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jremus at linux dot ibm.com @ 2024-02-02 14:33 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31328

Jens Remus <jremus at linux dot ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug gdb/31328] gdb fails to compile with clang due to missing parentheses
  2024-02-02 14:30 [Bug gdb/31328] New: gdb fails to compile with clang due to missing parentheses jremus at linux dot ibm.com
  2024-02-02 14:33 ` [Bug gdb/31328] " jremus at linux dot ibm.com
@ 2024-02-02 15:12 ` tromey at sourceware dot org
  2024-02-02 18:46 ` jremus at linux dot ibm.com
  2024-02-08 16:56 ` arnez at linux dot ibm.com
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at sourceware dot org @ 2024-02-02 15:12 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31328

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
Please send patches to the list.
See the contribution checklist:

https://sourceware.org/gdb/wiki/ContributionChecklist

In this case, the code is doing "!mumble == 0", which seems weird
I think changing it to != 0 would be better.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug gdb/31328] gdb fails to compile with clang due to missing parentheses
  2024-02-02 14:30 [Bug gdb/31328] New: gdb fails to compile with clang due to missing parentheses jremus at linux dot ibm.com
  2024-02-02 14:33 ` [Bug gdb/31328] " jremus at linux dot ibm.com
  2024-02-02 15:12 ` tromey at sourceware dot org
@ 2024-02-02 18:46 ` jremus at linux dot ibm.com
  2024-02-08 16:56 ` arnez at linux dot ibm.com
  3 siblings, 0 replies; 5+ messages in thread
From: jremus at linux dot ibm.com @ 2024-02-02 18:46 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31328

--- Comment #2 from Jens Remus <jremus at linux dot ibm.com> ---
Thanks! Will do on Monday.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug gdb/31328] gdb fails to compile with clang due to missing parentheses
  2024-02-02 14:30 [Bug gdb/31328] New: gdb fails to compile with clang due to missing parentheses jremus at linux dot ibm.com
                   ` (2 preceding siblings ...)
  2024-02-02 18:46 ` jremus at linux dot ibm.com
@ 2024-02-08 16:56 ` arnez at linux dot ibm.com
  3 siblings, 0 replies; 5+ messages in thread
From: arnez at linux dot ibm.com @ 2024-02-08 16:56 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31328

Andreas Arnez <arnez at linux dot ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |arnez at linux dot ibm.com
         Resolution|---                         |FIXED

--- Comment #3 from Andreas Arnez <arnez at linux dot ibm.com> ---
OK, I pushed Jens' updated version of the patch as
  commit 51d525db2edce2708d85 -- gdb: Fix building with clang
Which should resolve this particular build issue.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-02-08 16:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-02 14:30 [Bug gdb/31328] New: gdb fails to compile with clang due to missing parentheses jremus at linux dot ibm.com
2024-02-02 14:33 ` [Bug gdb/31328] " jremus at linux dot ibm.com
2024-02-02 15:12 ` tromey at sourceware dot org
2024-02-02 18:46 ` jremus at linux dot ibm.com
2024-02-08 16:56 ` arnez at linux dot ibm.com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).