http://llvm.org/bugs/show_bug.cgi?id=21498
Bug ID: 21498
Summary: UBSan: check size/type mismatch of global variables
across modules
Product: clang
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
C99 states that declaring same global variable with incompatible types in
different units of translation is undefined behavior (6.7.5.2 item 6). So e.g.
having int a[10]; in tmp.c and int a[100]; in tmp2.c would be a UB. We should
be able to check this easily by registering all referenced globals in .c in
libubsan via callbacks at program start. Libubsan could than find size/type
mismatches and report 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