[Bug c/68065] Size calculations for VLAs can overflow
ch3root at openwall dot com
gcc-bugzilla@gcc.gnu.org
Wed Oct 28 23:43:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68065
--- Comment #15 from Alexander Cherepanov <ch3root at openwall dot com> ---
On 2015-10-29 02:38, joseph at codesourcery dot com wrote:
>>> I think it's undefined at the point where a type exceeds the limit on the
>>> size of an object (half the address space minus one byte)
>>
>> Wait, "char a[SIZE_MAX / 2]" works in gcc 5.2. Should I file a bug?
>
> That's half the address space minus one byte (SIZE_MAX is odd, equal to
> (size_t) -1). That is, it's meant to be accepted, but one byte more
> shouldn't be.
Sure, of course, sorry for the noise.
More information about the Gcc-bugs
mailing list