xazax.hun added inline comments.

================
Comment at: lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp:126
+           << BinaryOperator::getOpcodeStr(B->getOpcode())
+           << "' expression is undefined due to shift count >= width of type";
+      } else {
----------------
danielmarjamaki wrote:
> zaks.anna wrote:
> > It's best not to use ">=" in diagnostic messages.
> > Suggestions: "due to shift count >= width of type" ->
> > - "due to shifting by a value larger than the width of type"
> > - "due to shifting by 5, which is larger than the width of type 'int'" // 
> > Providing the exact value and the type would be very useful and this 
> > information is readily available to us. Note that the users might not see 
> > the type or the value because of macros and such.
> I used "due to shifting by 5, which is larger than the width of type 'int'"
> 
> However I did not see an easy way to show the exact value. So I added 
> getConcreteValue(). Maybe you have a better suggestion. If it's a ConcreteInt 
> I show the exact value, but if it's some range etc then I write "due to 
> shifting by a value that is larger..." instead.
> 
> The message "due to shifting by 64, which is larger than the width of type 
> 'unsigned long long'" is a bit weird imho. Because 64 is not larger than the 
> width. Not sure how this can be rephrazed better though.
SValBuilder has a getKnownValue, does that help?


Repository:
  rL LLVM

https://reviews.llvm.org/D30295



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to