george.karpenkov added a comment.

Looks reasonable. Have you tried on any large codebases? You relax two guards, 
so I would be wary of explosion in false positives.



================
Comment at: lib/StaticAnalyzer/Checkers/ConversionChecker.cpp:77
     if (Opc == BO_Assign) {
-      LossOfSign = isLossOfSign(Cast, C);
-      LossOfPrecision = isLossOfPrecision(Cast, Cast->getType(), C);
+      if (!B->getRHS()->isIntegerConstantExpr(C.getASTContext())) {
+        LossOfSign = isLossOfSign(Cast, C);
----------------
Sorry, I don't quite follow: why we don't want to warn when RHS is an integer 
constant?


Repository:
  rC Clang

https://reviews.llvm.org/D46081



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

Reply via email to