This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36633] [4.4 regression] warning "array subscript is below array bounds" on delete [] with -O2, -Wall
- From: "chris dot fairles at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Jul 2008 13:41:21 -0000
- Subject: [Bug c++/36633] [4.4 regression] warning "array subscript is below array bounds" on delete [] with -O2, -Wall
- References: <bug-36633-14909@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #11 from chris dot fairles at gmail dot com 2008-07-10 13:41 -------
On x64_64, alignof(smart_ptr) == sizeof(size_t) == 8. So then the size of the
array is stored in the 8 bytes prior to the address of the returned pointer
from new[].
In the delete[] call, its offsetting the returned address by 8 which is correct
no? So isn't this a bogus warning?
Chris
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36633