git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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 --
Previous: Sverre RabbelierNext: Junio C Hamano
Message 5 of 9 in “fast-import.c: Silence build warning”
  1. fast-import.c: Silence build warningMichael Wookey, Aug 31, 2009
  2. Sverre RabbelierAug 31, 2009
  3. Alex RiesenAug 31, 2009
  4. Sverre RabbelierAug 31, 2009
  5. Michael WookeyAug 31, 2009
  6. Junio C HamanoAug 31, 2009
  7. Michael WookeyAug 31, 2009
  8. Stephen BoydSep 1, 2009
  9. Alex RiesenSep 1, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.