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

Re: [PATCH 0/4] fix make sparse warning

From
Ramsay Jones <ramsay@ramsayjones.plus.com>
Date
Apr 24, 2020, 16:38 UTC
Message-ID
<4ff17acf-42dc-5a00-bb61-b055144075eb@ramsayjones.plus.com>
In-Reply-To
<20200423235809.GA1949@danh.dev>
On 24/04/2020 00:58, Danh Doan wrote:
Show 14 quoted lines
> On 2020-04-24 00:10:25+0100, Ramsay Jones <ramsay@ramsayjones.plus.com> wrote:
>> On 23/04/2020 14:47, Đoàn Trần Công Danh wrote:
>>> It's happened that I tried to run make check on project that support autoconf.
>>
>> I try to ignore autoconf as much as possible, so I don't know why people
> 
> For some reason, people refer to autotools as autohell
> 
>> who use it regularly seem to expect a 'make check' target (is that anything
>> to do with ./config.status --recheck?).
> 
> Because it's autotools's recommendation.
> https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Basic-Installation.html#Basic-Installation
> https://www.gnu.org/software/automake/manual/automake.html#Standard-Targets
Ah, OK, that explains alot! :D

I have never seen that documented before, so thanks for the reference. Having said that, most all 'autotools' projects I have seen have had an 'make test' target and _not_ 'make check'! (Well, thinking about it, none of those were actual GNU projects - maybe that's the difference).

[snip]
Show 14 quoted lines
>> For those interested, the 'too much warnings' on the 'pu' branch looks
>> like (for pu@faf094bf11):
>>
>>   $ make sparse >psp-out 2>&1
>>   $ diff nsp-out psp-out
>>   154a155
>>   >     SP refs/reftable-backend.c
>>   406a408
>>   >     SP t/helper/test-proc-receive.c
>>   447a450,511
>>   >     SP reftable/basics.c
>>   > reftable/basics.c:157:6: warning: symbol 'reftable_malloc_ptr' was not declared. Should it be static?
>>   > reftable/basics.c:158:6: warning: symbol 'reftable_realloc_ptr' was not declared. Should it be static?
>>   > reftable/basics.c:159:6: warning: symbol 'reftable_free_ptr' was not declared. Should it be static?
[snip]
Show 14 quoted lines
>>   >     SP reftable/writer.c
>>   > reftable/writer.c:231:31: warning: Using plain integer as NULL pointer
>>   > reftable/writer.c:299:39: warning: Using plain integer as NULL pointer
>>   > reftable/writer.c:347:47: warning: Using plain integer as NULL pointer
>>   > reftable/writer.c:426:31: warning: Using plain integer as NULL pointer
>>   > reftable/writer.c:468:45: warning: Using plain integer as NULL pointer
>>   > reftable/writer.c:584:11: warning: symbol 'debug' was not declared. Should it be static?
>>   >     SP reftable/zlib-compat.c
>>
>> Also, my static-check perl script says the following symbols are not
>> used outside the file which defines them (so they could be marked static):
> 
> All of them are in reftable, and they're catched by `make sparse`,
> too.
Yeah, I didn't even look at the output. ;-)

However, the output from static-check.pl is usually a super-set of the those from sparse - because sparse is really only looking at the declarations (or lack thereof) in one compilation unit. In contrast, static-check.pl looks at all object files to tie up definitions with use (so across compilation units). (which is also why you have to be careful not to leave stale '*.o' files laying around when switching branches).

ATB, Ramsay Jones

Previous: Danh DoanNext: Đoàn Trần Công Danh
Message 19 of 51 in “fix make sparse warning”
  1. 0/4 fix make sparse warningĐoàn Trần Công Danh, Apr 23, 2020
  2. 1/4 C: s/0/NULL/ for pointer typeĐoàn Trần Công Danh, Apr 23, 2020
  3. Ramsay JonesApr 24, 2020
  4. Junio C HamanoApr 24, 2020
  5. Danh DoanApr 24, 2020
  6. Junio C HamanoApr 24, 2020
  7. Luc Van OostenryckMay 14, 2020
  8. 2/4 compat/regex: silence `make sparse` warningĐoàn Trần Công Danh, Apr 23, 2020
  9. Ramsay JonesApr 24, 2020
  10. Danh DoanApr 24, 2020
  11. 3/4 graph.c: limit linkage of internal variableĐoàn Trần Công Danh, Apr 23, 2020
  12. Ramsay JonesApr 24, 2020
  13. 4/4 progress.c: silence cgcc suggestion about internal linkageĐoàn Trần Công Danh, Apr 23, 2020
  14. Ramsay JonesApr 24, 2020
  15. Jeff KingApr 24, 2020
  16. 5/4 fmt-merge-msg.c: fix `make sparse` on nextĐoàn Trần Công Danh, Apr 23, 2020
  17. Ramsay JonesApr 23, 2020
  18. Danh DoanApr 23, 2020
  19. Ramsay JonesApr 24, 2020
  20. 0/4 Fix Sparse WarningĐoàn Trần Công Danh, Apr 24, 2020
  21. 1/4 test-parse-pathspec-file.c: s/0/NULL/ for pointer typeĐoàn Trần Công Danh, Apr 24, 2020
  22. 2/4 compat/regex: include alloca.h before undef itĐoàn Trần Công Danh, Apr 24, 2020
  23. Ramsay JonesApr 24, 2020
  24. Danh DoanApr 24, 2020
  25. Ramsay JonesApr 24, 2020
  26. Danh DoanApr 24, 2020
  27. Ramsay JonesApr 25, 2020
  28. Danh DoanApr 26, 2020
  29. Danh DoanApr 26, 2020
  30. Ramsay JonesApr 26, 2020
  31. Ramsay JonesApr 26, 2020
  32. Junio C HamanoApr 26, 2020
  33. Danh DoanApr 27, 2020
  34. Ramsay JonesApr 27, 2020
  35. Danh DoanApr 27, 2020
  36. Ramsay JonesApr 27, 2020
  37. 3/4 graph.c: limit linkage of internal variableĐoàn Trần Công Danh, Apr 24, 2020
  38. 4/4 progress.c: silence cgcc suggestion about internal linkageĐoàn Trần Công Danh, Apr 24, 2020
  39. Ramsay JonesApr 24, 2020
  40. Johannes SchindelinApr 25, 2020
  41. Danh DoanApr 26, 2020
  42. Ramsay JonesApr 26, 2020
  43. Johannes SchindelinMay 1, 2020
  44. 0/4 Partial fix `make sparse`Đoàn Trần Công Danh, Apr 27, 2020
  45. 1/4 test-parse-pathspec-file.c: s/0/NULL/ for pointer typeĐoàn Trần Công Danh, Apr 27, 2020
  46. 2/4 compat/regex: move stdlib.h up in inclusion chainĐoàn Trần Công Danh, Apr 27, 2020
  47. Ramsay JonesApr 27, 2020
  48. 3/4 graph.c: limit linkage of internal variableĐoàn Trần Công Danh, Apr 27, 2020
  49. 4/4 progress.c: silence cgcc suggestion about internal linkageĐoàn Trần Công Danh, Apr 27, 2020
  50. Johannes SchindelinMay 1, 2020
  51. Ramsay JonesApr 27, 2020

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.