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'.
struct simops
{
- char mnimonic[12];
+ char mnemonic[12];
uint32 size;
uint32 mask;
uint32 opcode;
mask = (((1 << (32 - h->mask)) -1) << h->mask);
/* Adjuest mask for branch with 2 word instructions. */
- if ((h->ops->mnimonic != NULL) &&
- ((streq(h->ops->mnimonic,"b") && h->size == 2)))
+ if (streq(h->ops->mnemonic,"b") && h->size == 2)
mask = 0xff0f0000;
mask = (((1 << (32 - h->mask)) -1) << h->mask);
/* Adjuest mask for branch with 2 word instructions. */
- if ((streq(h->ops->mnimonic,"b")) && h->size == 2)
+ if ((streq(h->ops->mnemonic,"b")) && h->size == 2)
mask = 0xff0f0000;
}