[splint-discuss] Porting 32 to 64 bits

Ibéria Medeiros ibemed at gmail.com
Tue Apr 10 06:43:30 PDT 2007


On 4/10/07, Michael Wojcik <Michael.Wojcik at microfocus.com> wrote:
> > From: splint-discuss-bounces at cs.virginia.edu [mailto:splint-discuss-bounces at cs.virginia.edu] On Behalf Of Ibéria Medeiros
> >       Sent: Monday, 09 April, 2007 18:40
>
> > I'am newbie with splint... and i like use the splint to give me warnings when i porting the 32 to 64 bits.
> > The lint tool has a flag -errchk=longptr64 to do that, where warning when
> > int = long
> > int = (cast) ptr
>
> *Some* lint tools have that flag.  There are many lint implementations.
>
> > With splint, how i do that??
>
> As far as I know, there's currently no splint check for assignment of a pointer type to an integer type with a (proper) cast.  If you cast, splint generally assumes you know what you're doing.

yes, this is true.. if iam development applications to 32 bits (data
model ILP32), where sizeof(int) = sizeof(long) = sizeof(ptr) = 32
bits.
If i build programs to 64 bits, to data model LP64, the size of
integral types are diferents... sizeof(int) = 32bits and sizeof(long)
= sizeof(ptr) = 64bits.

The problem is when i porting 32 bits to 64 bits, the instructions
int = long (32 = 64 bits, in LP64) lose bits, and splint with
-ignorequals set warning me
int = ptr or int = (cast)ptr (32 = 64 bits, in LP64), splint dont
warning! There is any flag in splint that detect this?

Thanks,
-- 
Ibéria Medeiros



More information about the splint-discuss mailing list