Re: [PATCH] fast-import.c: Silence build warning
- From
Michael Wookey <michaelwookey@gmail.com>
- Date
- Aug 31, 2009, 23:31 UTC
- Message-ID
- <d2e97e800908311631x6fdd7781v2e893d1ca62378b6@mail.gmail.com>
- In-Reply-To
- <81b0412b0908311427t5b4a24ffg1d7d272669476117@mail.gmail.com>
2009/9/1 Alex Riesen <raa.lkml@gmail.com>:
Show 7 quoted lines
> On Mon, Aug 31, 2009 at 14:29, Sverre Rabbelier<srabbelier@gmail.com> wrote: >> On Mon, Aug 31, 2009 at 04:21, Michael Wookey<michaelwookey@gmail.com> wrote: >>> Provide a dummy variable to keep the compiler happy. >> >> Should we not instead check the value? > > Why? It is endp (end of the parsed number) we're interested in.
Good point, perhaps the commit message should mention why we don't bother checking the return value. Something like this maybe?
-- >8 -- gcc 4.3.3 (Ubuntu 9.04) warns that the return value of strtoul() was not checked by issuing the following notice:
warning: ignoring return value of ‘strtoul’, declared with attribute warn_unused_result
The return value of strtoul() isn't used because we are only interested in what is placed into endp. As such, provide a dummy variable to keep the compiler happy.
Signed-off-by: Michael Wookey <michaelwookey@gmail.com> -- >8 --