http://llvm.org/bugs/show_bug.cgi?id=18875
Bug ID: 18875
Summary: No warning for function call through a non-compatible
type
Product: clang
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: normal
Priority: P
Component: Frontend
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Clang does not warn a function call through a non-compatible type. Such a
function call can lead to unexpected behavior, such as the following code.
$: cat s.c
int foo(double *x) {return (int)*x;}
typedef int (*F)(int*);
int main() {
int x = 0;
return ((F)foo)(&x);
}
$: clang-trunk -Weverything -Wno-missing-prototypes s.c
$: gcc-trunk s.c
s.c: In function ‘main’:
s.c:5:10: warning: function called through a non-compatible type
return ((F)foo)(&x);
^
$
$: clang-trunk --version
clang version 3.5 (trunk 201498)
Target: x86_64-unknown-linux-gnu
Thread model: posix
--
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