[PATCH] D44559: [Sema] Wrong width of result of mul operation

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 29 11:43:54 PDT 2018


rjmccall added a comment.

What would the design for that warning be?  C promotes all arithmetic on sub-int types to int, and if that's assigned back to a variable of the original type, there's a conversion.  But you seem to only want to warn about truncating the result of multiplication and not, say, addition or negation.  Is there a principle to this?  Just the likelihood of escaping the range of the original type?


https://reviews.llvm.org/D44559





More information about the cfe-commits mailing list