[LLVMbugs] [Bug 19053] New: clang can treat a dynamic POD variable as an array without warning/error
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Wed Mar 5 02:51:48 PST 2014
http://llvm.org/bugs/show_bug.cgi?id=19053
Bug ID: 19053
Summary: clang can treat a dynamic POD variable as an array
without warning/error
Product: clang
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: peter.bocan at azet.sk
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
Hello guys, we had at university this issue: compiling the code below, throws
no error messages whatsoever, but the code is, as you know, not working. It's,
at least for me, that compiler would recognize this type of mistakes and so it
would be kinda nice to have some type checking upon POD types.
The code is:
int main()
{
int* pod_type = new int(23);
for (int i = 0; i < 10000; i++)
pot_type[i] = 0xDEADC0DE;
delete pod_type;
return 0;
}
Thank you. (this bug has been already pushed to g++ bugtracker by me).
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140305/cd6c2775/attachment.html>
More information about the llvm-bugs
mailing list