[Bug c++/85783] alloc-size-larger-than fires incorrectly with new[] and can't be disabled

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon May 14 21:35:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85783

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Did you try:
-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.


More information about the Gcc-bugs mailing list