[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] tiny bit of lint

From: Michael Matz
Subject: Re: [Tinycc-devel] tiny bit of lint
Date: Mon, 8 May 2017 20:43:12 +0200 (CEST)
User-agent: Alpine 2.20 (LSU 67 2015-01-07)


On Mon, 8 May 2017, Christian Jullien wrote:

> tcc.h: (in function is_space)
> tcc.h:1244:12: Operands of == have incompatible types (int, char): ch == ' '
>   A character constant is used as an int. Use +charintliteral to allow
>   character constants to be used as ints.  (This is safe since the actual
> type
>   of a char constant is int.)

That's not a very useful warning.  As the explanation that splint itself 
is giving there's no danger of any misinterpretation of the meaning.

> tcc.h:1244:25: Operands of == have incompatible types (int, char): ch ==
> '\t'
> arm64-gen.c:49:31: Initializer block for reg_classes has 28 elements, but
>     declared as int [25]:

And this is simply wrong.  From arm64-gen:
% grep NB_REGS arm64-gen.c
arm64-gen.c:#define NB_REGS 28 // x0-x18, x30, v0-v7
arm64-gen.c:ST_DATA const int reg_classes[NB_REGS] = {

So, quite clearly reg_classes is declared as an int[28] just fine.  
splint is probably confused by the NB_REGS definition in x86_64-gen.c 
(which defines it to 25), but that's immaterial, those sources aren't used 
in arm64-gen.c.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]