This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/71218] Add a warning about "new T[integer-literal]"
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 21 May 2016 14:12:31 +0000
- Subject: [Bug c++/71218] Add a warning about "new T[integer-literal]"
- Auto-submitted: auto-generated
- References: <bug-71218-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71218
--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> ---
Can you be more specific? Do you mean people should have written:
T tab[8];
instead? What if 8 or sizeof(T) is large? If your "..." includes possible
writes to p, or if p escapes and "..." may throw, I guess that cancels the
warning? At some point the issue becomes similar to optimizing malloc to a
stack allocation.