This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/71218] Add a warning about "new T[integer-literal]"


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]