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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

-- Luc



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux