[Bug c++/85783] alloc-size-larger-than fires incorrectly with new[] and can't be disabled
psmith at gnu dot org
gcc-bugzilla@gcc.gnu.org
Mon May 14 21:51:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85783
--- Comment #2 from Paul Smith <psmith at gnu dot org> ---
> Did you try: -Wno-alloc-size-larger-than ?
Yes.
cc1plus: error: unrecognized command line option
'-Wno-alloc-size-larger-than'
> Also in your code, numberFields is a signed int and then casted to size_t. On LP64 targets (or rather sizeof(size_t) != sizeof(int)), then value is sign extended.
I'm not suggesting the code is well-written. Just that it shouldn't throw a
warning.
In any event, if I change numberFields to "unsigned int" I still get the same
warning.
More information about the Gcc-bugs
mailing list