Re: [PATCH] sparse: Make -Werror turn warnigns into errors

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

 



On Thu, Sep 4, 2014 at 2:54 AM, Thomas Graf <tgraf@xxxxxxx> wrote:
> Make sparse fail and return an error code if a warning is encountered
> and -Werror is specified or a hard error is found. This allows to use
> sparse in automated build systems to more easily catch new sparse
> warnings.

Most of the change looks fine.

>
> Due to sparse now returning non zero on failure, the test cases
> triggering a error have to be adapated to check for the non zero return
> value.
>
> diff --git a/validation/__func__.c b/validation/__func__.c
> index 65ce928..6003a86 100644
> --- a/validation/__func__.c
> +++ b/validation/__func__.c
> @@ -12,4 +12,5 @@ static void f(void)
>  __func__.c:5:29: error: Expected ; at end of declaration
>  __func__.c:5:29: error: got __func__
>   * check-error-end
> + * check-exit-value: 1
>   */

In stead of patching each test case file. How about teach the
test-suilte to be smarter? The test-suilte should change the default
return value to none zero if there is none empty "check-error-start" and
"check-error-end" section. In other words, if there is expected
error output, we already guess the returns status is error.
The test case can still use "check-exit-value" to overwrite the default
value.

I expect that can save most of the patching to test case file.

Thanks

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux