Thread (2 messages) 2 messages, 2 authors, 2017-06-13

./include/linux/err.h:35:16: warning: dereference of noderef expression

From: Luc Van Oostenryck <hidden>
Date: 2017-06-13 10:44:19
Also in: lkml

On Tue, Jun 13, 2017 at 11:55:26AM +0200, Charlemagne Lasse wrote:
Hi,

I have following code which generates a warning when compiling with "make C=1".

~~~~~~~
struct task_struct *kthread;
kthread = kthread_create(xxxxx, yyyyy, "zzzzz");
if (IS_ERR(kthread)) {
~~~~~~~

The warning is

    ./include/linux/err.h:35:16: warning: dereference of noderef expression

And disappears when I remove the IS_ERR. How do I correctly work
around this incorrect warning?

Btw. I am using Debian stretch amd64. It seems like this is related to
the __force used in the parameter list of IS_ERR. Removing it also
removes the warning.
The warning is indeed related to '__force' but it should be
the other way around.
Anyway, by just reading your three lines of code, you shouldn't
receive this warning, with or without the __force.
 
If it is fixed in sparse's git then when will there be a new release of it?
I can't reproduce your problem even on a three years old version
of sparse (more exactly git version d917662d5 of sparse, anything
older has build problems with half-recent kernels).

The pre-processed version of your file could be interesting
as well as the output of the make command but with the 'V=1'
option added.
 

Regards,
-- Luc Van Oostenryck
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help