This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug lto/51744] Erroneous warning: memset used with constant zero length parameter
- From: "mark at infocomm dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 24 Mar 2014 12:32:25 +0000
- Subject: [Bug lto/51744] Erroneous warning: memset used with constant zero length parameter
- Auto-submitted: auto-generated
- References: <bug-51744-4 at http dot gcc dot gnu dot org/bugzilla/>
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.