From: Julia Lawall <julia.lawall@lip6.fr>
To: Denis Efremov <efremov@linux.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>,
"Luis R . Rodriguez" <mcgrof@kernel.org>,
Nicolas Palix <nicolas.palix@imag.fr>,
Gilles Muller <Gilles.Muller@lip6.fr>,
Michal Marek <michal.lkml@markovi.net>,
linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org
Subject: Re: [PATCH] coccicheck: return proper error code on check fail
Date: Fri, 10 Aug 2018 16:28:58 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.20.1808101627230.3390@hadrien> (raw)
In-Reply-To: <CADKZ3FLsksV8-cCE6aOnZnLbYj3SSAkPnMs_VRQB3g0V3mUYcg@mail.gmail.com>
On Fri, 10 Aug 2018, Denis Efremov wrote:
> > Do you mean that there is an error in the behavior of coccicheck or that coccicheck finds an error in the source code?
>
> An error in the source code.
>
> Here is an example of how the patch changes the behavior of 'make
> coccicheck' (my comments after the ###):
> Current behavior:
> $ make M=mymodule coccicheck
> mymodule/file1.c:97:4-14: ERROR: Assignment of bool to non-0/1 constant
> mymodule/file2.c:104:4-19: ERROR: Assignment of bool to non-0/1 constant
> mymodule/file2.c:577:1-15: code aligned with following code on line 583
> mymodule/file3.c:439:5-10: Unneeded variable: "error". Return "0" on line 449
> mymodule/file4.c:451:5-7: Unneeded variable: "rc". Return "0" on line 455
> mymodule/file5.c:433:5-8: Unneeded variable: "ret". Return "0" on line 607
> mymodule/file6.c:433:5-10: Unneeded variable: "error". Return "0" on line 440
> mymodule/file7.c:774:2-3: Unneeded semicolon
> coccicheck failed ### <-- Check failed
Are you sure that this coccicheck failed has any connection to the various
messages printed above it? Normally Coccinelle has no idea about the
semantics of messages printed using python script code. I'm not sure what
would cause it to return an error code because a particular script was
activated.
julia
> $ echo $?
> 0 ### <-- But error code signals that everthing is OK
>
> After this patch:
> $ make M=mymodule coccicheck
> ...
> coccicheck failed
> make: *** [Makefile:1636: coccicheck] Error 2
> $ echo $?
> 2 ### <-- The patch changes error code
>
> Why does this matter?
> 1) Because it's clear from the source code that the original intention
> was to return an error code of checking command, not the "echo
> 'coccicheck failed'" command.
> 2) Automated testing systems (CI, for example) rely on the return code.
>
next prev parent reply other threads:[~2018-08-10 14:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-10 13:36 efremov
2018-08-10 13:42 ` Julia Lawall
2018-08-10 14:20 ` Denis Efremov
2018-08-10 14:28 ` Julia Lawall [this message]
2018-08-10 14:45 ` Denis Efremov
2018-08-10 18:23 ` Himanshu Jha
2018-08-10 20:25 ` [PATCH v2] coccicheck: return proper error code on fail efremov
2018-08-10 20:31 ` Julia Lawall
2018-08-13 7:28 ` Masahiro Yamada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.20.1808101627230.3390@hadrien \
--to=julia.lawall@lip6.fr \
--cc=Gilles.Muller@lip6.fr \
--cc=efremov@linux.com \
--cc=ldv-project@linuxtesting.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=michal.lkml@markovi.net \
--cc=nicolas.palix@imag.fr \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®