public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* checkpatch warnings in sched.h
@ 2019-09-20  7:34 Steve French
  2019-09-20 10:25 ` Dan Carpenter
  2019-09-30 16:30 ` Luc Van Oostenryck
  0 siblings, 2 replies; 3+ messages in thread
From: Steve French @ 2019-09-20  7:34 UTC (permalink / raw)
  To: LKML; +Cc: Dan Carpenter

Any hints to get rid of the noisy warnings in sched.h that make it
hard to spot real warnings:

/include/linux/sched.h:609:43: error: bad integer constant expression
/include/linux/sched.h:609:73: error: invalid named zero-width bitfield `value'

I noticed mention of this on lkml but didn't see any suggested
solution to this distracting warning

-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: checkpatch warnings in sched.h
  2019-09-20  7:34 checkpatch warnings in sched.h Steve French
@ 2019-09-20 10:25 ` Dan Carpenter
  2019-09-30 16:30 ` Luc Van Oostenryck
  1 sibling, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2019-09-20 10:25 UTC (permalink / raw)
  To: Steve French, Nicolai Stange, Luc Van Oostenryck, Chris Li
  Cc: LKML, linux-sparse

On Fri, Sep 20, 2019 at 02:34:46AM -0500, Steve French wrote:
> Any hints to get rid of the noisy warnings in sched.h that make it
> hard to spot real warnings:
> 
> /include/linux/sched.h:609:43: error: bad integer constant expression
> /include/linux/sched.h:609:73: error: invalid named zero-width bitfield `value'
> 

This is a bug in Sparse and it's way worse than you think.  It actually
disables the real Sparse warnings because now Sparse thinks it has
encountered a parse error.  I think we should just ifdef out that Sparse
code.

The problem is that if you have code like:

	1 ? 1 :__bits_per()

GCC treats that as a compile constant but Sparse says that it's not
because all three elements of the conditional statement have to be
constant.  See the code in evaluate_conditional_expression().  The
complication is that Sparse sets the constant flags before calls
expand_expression() to see what the condition part of the statement is
so the code needs to shuffled around to set the constant bits to match
GCC.

I'm going to #ifdef this out for Smatch later today but someone needs
to do the same thing in Sparse because right now no one can check for
endian bugs until this gets fixed.  It's been broken for a month so
we'll probably get a flood of patches marking functions as static once
we patch this and people start seeing that warning again.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: checkpatch warnings in sched.h
  2019-09-20  7:34 checkpatch warnings in sched.h Steve French
  2019-09-20 10:25 ` Dan Carpenter
@ 2019-09-30 16:30 ` Luc Van Oostenryck
  1 sibling, 0 replies; 3+ messages in thread
From: Luc Van Oostenryck @ 2019-09-30 16:30 UTC (permalink / raw)
  To: Steve French; +Cc: LKML, Dan Carpenter

On Fri, Sep 20, 2019 at 02:34:46AM -0500, Steve French wrote:
> Any hints to get rid of the noisy warnings in sched.h that make it
> hard to spot real warnings:
> 
> /include/linux/sched.h:609:43: error: bad integer constant expression
> /include/linux/sched.h:609:73: error: invalid named zero-width bitfield `value'
> 
> I noticed mention of this on lkml but didn't see any suggested
> solution to this distracting warning

Hi,

This is now fixed in sparse's upstream.

Best regards,
-- Luc

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-30 16:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-20  7:34 checkpatch warnings in sched.h Steve French
2019-09-20 10:25 ` Dan Carpenter
2019-09-30 16:30 ` Luc Van Oostenryck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox