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

Re: [PATCH 0/1] Using sparse in a CI job

From
Ramsay Jones <ramsay@ramsayjones.plus.com>
Date
Feb 3, 2019, 15:19 UTC
Message-ID
<29138259-51cb-dec5-6f99-865868a00366@ramsayjones.plus.com>
In-Reply-To
<20190201223959.zmlyg4buwolw2b3p@ltop.local>
On 01/02/2019 22:40, Luc Van Oostenryck wrote:
Show 30 quoted lines
> On Fri, Feb 01, 2019 at 09:01:20PM +0000, Ramsay Jones wrote:
>>
>> I suspect that the Makefile sparse target is not easy to use in a CI
>> job, since the 'sparse' program (via cgcc -no-compile) does not exit
>> with a non-zero value, even when issuing errors and warnings.
> 
> ...
>  
>> We can change that by passing '-Wsparse-error' to 'sparse':
>>
>>   $ make SPARSE_FLAGS=-Wsparse-error change-table.sp
>>       SP change-table.c
>>   change-table.h:53:24: error: dubious one-bit signed bitfield
>>   change-table.h:54:25: error: dubious one-bit signed bitfield
>>   change-table.h:55:25: error: dubious one-bit signed bitfield
>>   change-table.h:56:26: error: dubious one-bit signed bitfield
>>   Makefile:2729: recipe for target 'change-table.sp' failed
>>   make: *** [change-table.sp] Error 1
>>   $ echo $?
>>   2
>>   $ 
>>
>> Note that '-Wsparse-error' not only returns a non-zero exit code (1), but
>> it also changes a 'warning' into an 'error' (see above):
> 
> Yes, I know :(
> The fact that, by default, sparse doesn't fail on errors is wanted
> (otherwise it would break the kernel compile). But that the only way
> to return an error is to use -Wsparse-error (which is supposed to
> replace GCC's -Werror) is a real problem.

Given that I only use sparse as a checker, I actually don't mind the current behaviour. That would be different if I was using sparsec/sparsei etc., as a compiler, of course! ;-)

[If I were to suggest any change at all to -Wsparse-error it would be: do not change the 'warning' to an 'error' (yes, the actual text label of the message), exit(1) if any errors or warnings, but *if* only warnings have been issued, then print an "treating warnings as errors [-Wsparse-error]" message.]

ATB, Ramsay Jones

Previous: Luc Van OostenryckNext: SZEDER Gábor
Message 3 of 7 in “Using sparse in a CI job”
  1. 0/1 Using sparse in a CI jobRamsay Jones, Feb 1, 2019
  2. Luc Van OostenryckFeb 1, 2019
  3. Ramsay JonesFeb 3, 2019
  4. SZEDER GáborFeb 2, 2019
  5. Ramsay JonesFeb 3, 2019
  6. SZEDER GáborFeb 3, 2019
  7. Ramsay JonesFeb 3, 2019

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.