Go to file
Nico Weber 0e6daefe8f Warn on mismatched parentheses in memcmp and friends.
Thisadds a new warning that warns on code like this:

  if (memcmp(a, b, sizeof(a) != 0))

The warning looks like:

test4.cc:5:30: warning: size argument in 'memcmp' call is a comparison [-Wmemsize-comparison]
  if (memcmp(a, b, sizeof(a) != 0))
                   ~~~~~~~~~~^~~~
test4.cc:5:7: note: did you mean to compare the result of 'memcmp' instead?
  if (memcmp(a, b, sizeof(a) != 0))
      ^                          ~
                            )
test4.cc:5:20: note: explicitly cast the argument to size_t to silence this warning
  if (memcmp(a, b, sizeof(a) != 0))
                   ^
                   (size_t)(     )
1 warning generated.

This found 2 bugs in chromium and has 0 false positives on both chromium and
llvm.

The idea of triggering this warning on a binop in the size argument is due to
rnk.

llvm-svn: 198063
2013-12-26 23:38:39 +00:00
clang Warn on mismatched parentheses in memcmp and friends. 2013-12-26 23:38:39 +00:00
clang-tools-extra Clang-tidy: added --disable-checks, --list-checks options. 2013-12-19 19:57:05 +00:00
compiler-rt [ASan] Delete asan_intercepted_functions.h, move the code into asan_interceptors.h 2013-12-26 15:34:31 +00:00
debuginfo-tests don't use CHECK-NEXT because it may be on the same line. 2013-09-18 23:01:54 +00:00
libclc Add floating-point macro definitions v2 2013-12-20 05:13:42 +00:00
libcxx Make cv_status a class enum. Fixes PR18314. Thanks to Andersca for the report and the patch. 2013-12-23 22:14:27 +00:00
libcxxabi Add a first cut at a Registers_arm class, to be used for 32bit arm EHABI unwinding. 2013-12-18 17:53:55 +00:00
lld Fix a bug that undefined symbols are not reported if dead-stripping is enabled. 2013-12-26 08:37:16 +00:00
lldb Fix sidebar links 2013-12-26 07:23:52 +00:00
llvm TLI: Make exp10* avaiable on Linux/Mac/iOS and unavailable elsewhere 2013-12-26 19:17:04 +00:00
openmp For your Christmas hacking pleasure. 2013-12-23 17:28:57 +00:00
polly www: Simplify css 2013-12-21 00:26:05 +00:00