[Bug c++/36633] [4.4 regression] warning "array subscript is below array bounds" on delete [] with -O2, -Wall

chris dot fairles at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Jul 10 13:42:00 GMT 2008



------- 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



More information about the Gcc-bugs mailing list