[Bug lto/51744] Erroneous warning: memset used with constant zero length parameter

mark at infocomm dot com gcc-bugzilla@gcc.gnu.org
Mon Mar 24 12:32:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51744

--- Comment #9 from Mark Pizzolato <mark at infocomm dot com> ---
> When val == 0 then the case of len == 0 is ambiguous and you can't really
tell the user they swapped val and len (because they are equal).

That is certainly true.

I'm not sure how that specifically relates to the problem since the warning
message is only about the length being 0.

The problem is that the warning is being issued incorrectly when the set value
is != 0 and the length is not a constant.



More information about the Gcc-bugs mailing list