http://llvm.org/bugs/show_bug.cgi?id=8876
Summary: Incorrect warning about non-volatile NULL pointer
dereference
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
null.c:
{{{
#define A(err_ptr) do { \
if (err_ptr) *(int*)(err_ptr) = 1; \
} while (0)
int main() {
A(0);
return 0;
}
}}}
The macro `A()` was reduced from a larger mutex-managing macro.
{{{
$ clang null.c
null.c:6:3: warning: indirection of non-volatile null pointer will be deleted,
not trap [-Wnull-dereference]
A(0);
^~~~
null.c:2:18: note: instantiated from:
if (err_ptr) *(int*)(err_ptr) = 1; \
^~~~~~~~~~~~~~~~
null.c:6:3: note: consider using __builtin_trap() or qualifying pointer with
'volatile'
1 warning generated.
}}}
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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