public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb: fix clang build failure in msymbol_is_mips
@ 2022-04-13 18:38 Simon Marchi
  0 siblings, 0 replies; only message in thread
From: Simon Marchi @ 2022-04-13 18:38 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=febb368c894f53bd9bf0b198e0143eac02391053

commit febb368c894f53bd9bf0b198e0143eac02391053
Author: Simon Marchi <simon.marchi@efficios.com>
Date:   Wed Apr 13 11:25:08 2022 -0400

    gdb: fix clang build failure in msymbol_is_mips
    
    Building with clang++-14, I see:
    
          CXX    mips-tdep.o
        /home/smarchi/src/binutils-gdb/gdb/mips-tdep.c:453:12: error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
          return !(MSYMBOL_TARGET_FLAG_MIPS16 (msym)
                  ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        /home/smarchi/src/binutils-gdb/gdb/mips-tdep.h:54:2: note: expanded from macro 'MSYMBOL_TARGET_FLAG_MIPS16'
                (sym)->target_flag_1 ()
                ^
        /home/smarchi/src/binutils-gdb/gdb/mips-tdep.c:453:12: note: cast one or both operands to int to silence this warning
        /home/smarchi/src/binutils-gdb/gdb/mips-tdep.h:54:2: note: expanded from macro 'MSYMBOL_TARGET_FLAG_MIPS16'
                (sym)->target_flag_1 ()
                ^
    
    That's since commit e165fcef1e7 ("gdb: remove MSYMBOL_TARGET_FLAG_{1,2}
    macros").  Fix this by using the boolean || rather than the bitwise |,
    since the new methods return bool values.  No change in behavior
    expected.
    
    Change-Id: Ia82664135aa25db64c29c92f5c1141859d345bf7

Diff:
---
 gdb/mips-tdep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index f31dacd4c7c..354c2b54e07 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -451,7 +451,7 @@ static int
 msymbol_is_mips (struct minimal_symbol *msym)
 {
   return !(MSYMBOL_TARGET_FLAG_MIPS16 (msym)
-	   | MSYMBOL_TARGET_FLAG_MICROMIPS (msym));
+	   || MSYMBOL_TARGET_FLAG_MICROMIPS (msym));
 }
 
 /* Return one iff MSYM refers to MIPS16 code.  */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-13 18:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-13 18:38 [binutils-gdb] gdb: fix clang build failure in msymbol_is_mips Simon Marchi

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).