GCC 8.1: alloc-size-larger-than warnings during operator new[]
Marc Glisse
marc.glisse@inria.fr
Sun May 13 21:01:00 GMT 2018
On Sun, 13 May 2018, Paul Smith wrote:
> On Sun, 2018-05-13 at 15:53 -0400, Paul Smith wrote:
>> The first problem is that I have three instances (in a very large
>> codebase) where I'm seeing errors like this:
>>
>> error: argument 1 value '18446744073709551615' exceeds maximum object
>> size 9223372036854775807 [-Werror=alloc-size-larger-than=]
>>
>> ...
>>
>> I can disable this warning
>
> Err... no I can't? Isn't there some way to keep -Wall but disable
> -Walloc-size-larger-than? -Wno-alloc-size-larger-than is unrecognized
> and -Walloc-size-larger-than=0 doesn't disable it...
>
> ??
It does seem harder to disable than it should be. File a PR?
In my opinion, just like -Wmaybe-uninitialized, it should not be in -Wall
but only -Wextra (except possibly when the statement post-dominates the
entry of a function that is not a clone, or some similar constraint that
avoids all the false positives due to optimization artifacts).
--
Marc Glisse
More information about the Gcc-help
mailing list