lkml.org 
[lkml]   [2013]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: kernel/workqueue.c:4434:61: sparse: expression using sizeof bool
Hey,

On Thu, Apr 04, 2013 at 09:42:09AM +0800, Fengguang Wu wrote:
> > > 4433 /* copy worker description */
> > > > 4434 probe_kernel_read(&desc_valid, &worker->desc_valid, sizeof(desc_valid));
> > > 4435 if (desc_valid)
> >
> > I don't know what to make of this warning. Yes, it's probing a bool
> > variable and of course using sizeof(bool) to do that. Why does sparse
> > complain about this?
>
> I guess sparse warns on sizeof(bool) because it is compiler defined.
> It may be 1, 4, or even 8 depending on the gcc version and platform.

Yeah, it's copying out a bool so as long as that's the actual size,
it's okay. I mean, it's not like sizeof(long) is constant across
platforms. I'm gonna ignore it but still curious what the warning is
good for.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2013-04-04 18:01    [W:0.027 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site