http://llvm.org/bugs/show_bug.cgi?id=19679
Bug ID: 19679
Summary: Warn when the return value of memcpy is compared to 0
Product: clang
Version: 3.4
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Consider this code:
```
#include <string.h>
int f(char *a);
int f(char *a)
{
return memcpy(a, "test", 4) != 0;
}
```
It is clear that this memcpy should actually be memcmp. The comparison makes no
sense and should cause clang to emit a warning.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs