Re: [PATCH] cr16: fix build on gcc-12 (NULL comparison)

Sergei Trofimovich via Cgen <[email protected]> Sun, 14 Nov 2021 18:34:14 +0000
Newsgroups gmane.comp.tools.cgen.devel
Message-ID <20211114183400.31449948@nz>
On Sun, 14 Nov 2021 13:13:54 -0500
Mike Frysinger <[email protected]> wrote:

> On 14 Nov 2021 17:42, Sergei Trofimovich via Cgen wrote:
> > From: Sergei Trofimovich <[email protected]>
> > 
> > On gcc-12 build fails as:
> > 
> >     sim/cr16/interp.c: In function 'lookup_hash':
> >     sim/cr16/interp.c:89:25: error:
> >       the comparison will always evaluate as 'true'
> >       for the address of 'mnimonic' will never be NULL [-Werror=address]
> >        89 |   if ((h->ops->mnimonic != NULL) &&
> >           |                         ^~
> > 
> > 'mnimonic' is a sharr array within ops. It can never be NULL.
> > 
> > While at it renamed 'mnimonic' to 'mnemonic'.
> > ---
> >  sim/cr16/cr16_sim.h | 2 +-
> >  sim/cr16/interp.c   | 5 ++---
> >  2 files changed, 3 insertions(+), 4 deletions(-)  
> 
> this code doesn't exist in cgen.  did you mean to send the patch here ?
> -mike

My fault of not being able to read binutils-gdb/MAINTAINERS file.
I somehow read 'cgen/; cgen parts of opcodes/, sim/' as "all of sim/"
goes here.

Will resend to [email protected].

Thank you!


-- 

  Sergei