lint and ioctl parameter types (4.2 BSD)

Per Hedeland per at erix.UUCP
Sat Apr 14 06:48:05 AEST 1984


<>

>	On my system the first two parameters are type int and VARARGS2 
>	is specified.  I never get complaints about ioctl from lint.

VARARGS2 certainly shuts lint up about the third argument (it wasn't in our
llib-lc, by the way), but that doesn't answer the original question on
portability etc (I won't either), much less explains the problems with
the second argument.

Since I've been puzzled by those complaints too, I decided to have a closer
look; it turned out that lint is perfectly happy when told (in llib-lc) that
the second argument is a long!

Grab Our Most Beloved Reference Manual, para 2.4.1 Integer constants:
"... an octal or hex constant which exceeds the largest unsigned machine
integer is likewise taken to be long". Hmmm... this is a vax, so that should
mean "more than 32 bits used", which clearly isn't the case even with
0x80000000.

If you haven't guessed it already, a bit of testing will show you that lint
thinks that the size of an "unsigned machine integer" is 16 bits, no more!
While lint certainly should complain about passing 32 bits as an int when
given the -p option, the above behaviour seems very *wrong* to me. Or should
llib-lc give the second argument as long on 4.2?

Why your lint doesn't complain is a mystery to me (I wouldn't mind being
enlightened). You *are* running 4.2, aren't you?

Per Hedeland   {decvax,philabs}!mcvax!enea!erix!per  or  per at erix.UUCP



More information about the Comp.unix.wizards mailing list