This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/32887] warning for memset with zero size
- From: "manu at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Jul 2007 16:58:47 -0000
- Subject: [Bug middle-end/32887] warning for memset with zero size
- References: <bug-32887-14862@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #15 from manu at gcc dot gnu dot org 2007-07-26 16:58 -------
(In reply to comment #14)
> Subject: Re: warning for memset with zero size
>
> On 26 Jul 2007 13:57:41 -0000, manu at gcc dot gnu dot org
> <gcc-bugzilla@gcc.gnu.org> wrote:
> >
> > I think that is a sensible feature request, am I missing something Andrew?
>
> memset with a zero size is valid code.
>
I am not saying that is invalid. I am saying that it is a statement with no
effect. So it could be warned as we warn for: { 0; }
Perhaps memset with size 0 appears frequently in real-code as the result of
macro expansions or such. Then, this must be closed as WONTFIX and similar
requests can be directed at this PR.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32887