================
Comment at: clang-tidy/google/MemsetZeroLengthCheck.cpp:60
@@ +59,3 @@
+  // Try to evaluate the second argument so we can also find values that are 
not
+  // just literals. We don't emit a warning if the second argument also
+  // evaluates to zero.
----------------
Alexander Kornienko wrote:
> Maybe we should emit a warning, that this call is a no-op?
Fixed.

================
Comment at: clang-tidy/google/MemsetZeroLengthCheck.cpp:64
@@ +63,3 @@
+  if (!Arg2->EvaluateAsInt(Value2, *Result.Context) || Value2 != 0 ||
+      (Arg1->EvaluateAsInt(Value1, *Result.Context) && Value1 == 0))
+    return;
----------------
Alexander Kornienko wrote:
> I'd say Value1 < 0 is also not when we want to swap the arguments.
That seems like an incredibly weak heuristic. Zero-sized memsets should not 
occur in real code :(

http://reviews.llvm.org/D4535



_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to