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

Re: [PATCH] pkt-line: Fix sparse errors and warnings

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Feb 26, 2013, 19:02 UTC
Message-ID
<512D06E3.5020109@ramsay1.demon.co.uk>
In-Reply-To
<20130223223700.GB2504@sigill.intra.peff.net>
Jeff King wrote:
Show 28 quoted lines
> On Sat, Feb 23, 2013 at 05:31:34PM -0500, Jeff King wrote:
> 
>> On Sat, Feb 23, 2013 at 06:44:04PM +0000, Ramsay Jones wrote:
>>
>>> Sparse issues the following error and warnings:
>>>
>>>     pkt-line.c:209:51: warning: Using plain integer as NULL pointer
>>>     sideband.c:41:52: warning: Using plain integer as NULL pointer
>>>     daemon.c:615:39: warning: Using plain integer as NULL pointer
>>>     remote-curl.c:220:75: error: incompatible types for operation (>)
>>>     remote-curl.c:220:75:    left side has type char *
>>>     remote-curl.c:220:75:    right side has type int
>>>     remote-curl.c:291:53: warning: Using plain integer as NULL pointer
>>>     remote-curl.c:408:43: warning: Using plain integer as NULL pointer
>>>     remote-curl.c:562:47: warning: Using plain integer as NULL pointer
>>>
>>> All of these complaints "blame" to commit 17243606 ("pkt-line: share
>>> buffer/descriptor reading implementation", 20-02-2013).
>>>
>>> In order to suppress the warnings, we simply replace the integer
>>> constant 0 with NULL.
>> [...]
>> Oddly, you seemed to miss the one in connect.c (which my sparse does
>> detect).
> 
> Ah, I saw why as soon as I finished off the rebase: that (NULL, 0) goes
> away in the very next patch, and you probably ran sparse just on the tip
> of the topic (via pu). 

Yes, sorry I should have mentioned that! Ahem, *blush* [Having created and tested the patch (including running "make test") on the tip of pu, I applied the patch directly to commit 17243606 (using git-am). Since it applied cleanly and git-show looked OK, I said to myself "yep, that's OK, send it" ;-) ]

>                         I still think it's worth fixing since we are
> squashing anyway. Junio, it will give you a trivial conflict on patch
> 16, but you can just resolve in favor of what patch 16 does. If it's
> easier, here's the revised patch 16:
So, sorry for being a bit sloppy guys!

ATB, Ramsay Jones

Previous: Junio C HamanoNext: Ramsay Jones
Message 5 of 6 in “pkt-line: Fix sparse errors and warnings”
  1. pkt-line: Fix sparse errors and warningsRamsay Jones, Feb 23, 2013
  2. Jeff KingFeb 23, 2013
  3. Jeff KingFeb 23, 2013
  4. Junio C HamanoFeb 24, 2013
  5. Ramsay JonesFeb 26, 2013
  6. Ramsay JonesFeb 26, 2013

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.