This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Questionable code in gcov-io.c
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Bernd Schmidt <bschmidt at redhat dot com>
- Cc: Marek Polacek <polacek at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 12 Oct 2016 14:54:28 +0200
- Subject: Re: Questionable code in gcov-io.c
- Authentication-results: sourceware.org; auth=none
- References: <20161012121001.GA27295@redhat.com> <eba27513-c678-13ac-0fdd-b5ba1aad00be@redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Oct 12, 2016 at 02:23:36PM +0200, Bernd Schmidt wrote:
> >It seems that lines 198 and 200 do the same thing, at line 200 we know that
> >mode == 0, so we just assign 1. Should we just remove the condition on line 197?
>
> The intention seems to be that a negative gcov_var.mode means we're writing,
> so for a size zero file maybe that's the expected result. But of course none
> of the existing code is going to expect that.
>
> There are more oddities here...
Unfortunately I really don't remember, and it seems we don't have the
posting in gcc-patches archive at all.
Found it in http://marc.info/?l=gcc-patches&m=107747608611324 though.
Jakub