Subject: Re: CVS commit: src/usr.bin/xlint/lint1
To: Christian Biere <christianbiere@gmx.de>
From: Jason Thorpe <thorpej@shagadelic.org>
List: source-changes
Date: 10/18/2006 09:42:32
On Oct 18, 2006, at 7:29 AM, Christian Biere wrote:

> 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.

I mean as arguments to functions.

>
> -- 
> Christian

-- thorpej