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

Re: [PATCH] daemon.c: mark a file-local symbol as static

From
Jeff King <peff@peff.net>
Date
Feb 22, 2016, 21:18 UTC
Message-ID
<20160222211827.GB15595@sigill.intra.peff.net>
In-Reply-To
<56CA5753.9030308@ramsayjones.plus.com>
On Mon, Feb 22, 2016 at 12:33:23AM +0000, Ramsay Jones wrote:
Show 12 quoted lines
> > Thanks, will do. You notice these with sparse, as I recall? I've meant
> > to look into running that myself, but it looks like we are not
> > warning-free with sparse currently. I see complaints like:
> > 
> >   connect.c:377:40: warning: incorrect type in argument 2 (invalid types)
> >   connect.c:377:40:    expected union __CONST_SOCKADDR_ARG [usertype] __addr
> >   connect.c:377:40:    got struct sockaddr *ai_addr
> > 
> > As far as I can tell, that's just noise. Do you have a ready-made recipe
> > for silencing it?
> 
> Ah, I think you must be on a very old version of sparse.

I have whatever comes with debian unstable. Looks like 0.5.0 from November. So not _that_ old, but I can well believe it is missing tweaks found at the tip of their development.

I guess I was wondering whether I should be adding "make sparse" to my set of pre-submission checks. But I can't say I'm enthused about manually keeping another tool up to date. :)

> On Linux, there is a single warning, which results from a hard-coded
> value (max size of memcpy et. al., used for the kernel) which should
> at least be settable from the command line (I have a patch somewhere
> which I have not sent upstream).

Yeah, I saw that one, for a large zeroing memset of a heap buffer. I don't think it's _wrong_, though it would probably not hurt to use xcalloc instead.

Thanks for the pointers.
-Peff
Previous: Ramsay JonesNext: Ramsay Jones
Message 4 of 5 in “daemon.c: mark a file-local symbol as static”
  1. daemon.c: mark a file-local symbol as staticRamsay Jones, Feb 21, 2016
  2. Jeff KingFeb 21, 2016
  3. Ramsay JonesFeb 22, 2016
  4. Jeff KingFeb 22, 2016
  5. Ramsay JonesFeb 23, 2016

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.