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++/36633] [4.4 regression] warning "array subscript is below array bounds" on delete [] with -O2, -Wall



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


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