[net.lang.c] Why does S5 lint dislike casts to long?

Jeff Dean <jeff@aids-unix> (11/22/84)

I don't have SysV, but: have you tried the "-a" option?
On AT&T versions of Unix (SysIII and after), it should
suppress error messages about long assignments.

In 4.1bsd, the "-a" option is reversed -- you use it to get
(not suppress) messages about long assignments.  The error
message about incorrect sign extension is still there, but
apparently someone at Berkeley decided that the message
wasn't likely to be useful to anyone, and so it only comes
out if you use the "-a" option two (or more) times (this
is, of course, undocumented in the manual page).

lint definitely needs a way to handle "I know that's a
problem but I don't want to hear about it."  Explicit casts
(when type conversion is the problem) are very good for
that purpose; the "lint comments" are also useful.
Unfortunately, there are instances where neither suffice.
I don't know of anyone who has come up with a better (more
general purpose) scheme for doing this.  If you feel that
adding explicit casts is "cluttering" the code, you're
unlikely to find a generally acceptable solution.  I'd say
that it is advantageous to explicitly mark any code that
fails to pass through a program checker (such as lint) to
assist future maintainers and others who may have to work
with the code.

	jd

henry@utzoo.UUCP (Henry Spencer) (11/24/84)

> I don't have SysV, but: have you tried the "-a" option?
> On AT&T versions of Unix (SysIII and after), it should
> suppress error messages about long assignments.
> 
> In 4.1bsd, the "-a" option is reversed -- you use it to get
> (not suppress) messages about long assignments. ...

Berkeley is not to blame for this difference; that's the way it
was in the beginning, in V7.  It was AT&T that changed it.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry