[cfe-dev] New cast check

Anders Rönnholm Anders.Ronnholm at evidente.se
Wed Sep 24 04:40:10 PDT 2014


Hi,

I'm going to start working on a check on dangerous long casts, like pc lint warning 647.

e.g
int a = 105000;
int b = 25000;
long l = a*b; // possible truncation before conversion from 'int' to 'long'

I'm thinking of adding this to the AnalyzeImplicitConversions function in SemaChecking.

I will also create a CheckExplicitConversions function for cases like.

(long) (n << 8)

Would this be a good place to put it?

//Anders

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140924/7283eb4f/attachment.html>


More information about the cfe-dev mailing list