Source-Changes archive

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

Re: CVS commit: src/usr.bin/xlint/lint1



Jason Thorpe wrote:
> modify lint to issue a warning about a constant that  
> is being cast to a type when the constant would have already fit into  
> that type's range.

I hope you really mean that as a special purpose tool only. Such warnings
would cause false-positives complaining about casts that are absolutely
necessary e.g. "(uint64_t) 1 << x".  Also casting char to signed or unsigned
char is sometimes necessary too for portability reasons as char maybe signed
or not which would cause implementation-dependent behaviour if relying on
implicit int promotion.

-- 
Christian



Home | Main Index | Thread Index | Old Index