diff options
author | Erik Pilkington <erik.pilkington@gmail.com> | 2018-07-23 16:24:14 +0000 |
---|---|---|
committer | Erik Pilkington <erik.pilkington@gmail.com> | 2018-07-23 16:24:14 +0000 |
commit | c79b881ccd63fdedf917b2e766f02860dc97d124 (patch) | |
tree | f3702af83e40d220a218aa56d8394d5a08e534d7 /clang/test/Sema/transpose-memset.c | |
parent | 307e5b31ce7149e04a0357a48f7d1904b4c00233 (diff) | |
download | bcm5719-llvm-c79b881ccd63fdedf917b2e766f02860dc97d124.tar.gz bcm5719-llvm-c79b881ccd63fdedf917b2e766f02860dc97d124.zip |
[Sema] Don't emit -Wmemset-transposed-args for memset(p,0,0)
Thanks to Arthur O'Dwyer for the suggestion!
llvm-svn: 337706
Diffstat (limited to 'clang/test/Sema/transpose-memset.c')
-rw-r--r-- | clang/test/Sema/transpose-memset.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/test/Sema/transpose-memset.c b/clang/test/Sema/transpose-memset.c index 0180d5051e5..6112fde3406 100644 --- a/clang/test/Sema/transpose-memset.c +++ b/clang/test/Sema/transpose-memset.c @@ -22,6 +22,7 @@ int main() { memset(array, (int)sizeof(array), (0)); // no warning memset(array, (int)sizeof(array), 32); // no warning memset(array, 32, (0)); // no warning + memset(array, 0, 0); // no warning bzero(ptr, 0); // expected-warning{{'size' argument to bzero is '0'}} expected-note{{parenthesize the second argument to silence}} real_bzero(ptr, 0); // expected-warning{{'size' argument to bzero is '0'}} expected-note{{parenthesize the second argument to silence}} @@ -55,6 +56,6 @@ void macros() { __builtin_memset(array, 0, ZERO); // no warning __builtin_bzero(array, ZERO); - __builtin_memset(array, 0, 0); // expected-warning{{'size' argument to memset}} // expected-note{{parenthesize}} + __builtin_memset(array, 1, 0); // expected-warning{{'size' argument to memset}} // expected-note{{parenthesize}} __builtin_bzero(array, 0); // expected-warning{{'size' argument to bzero}} // expected-note{{parenthesize}} } |