Linux SPARSE checker discussions
 help / color / mirror / Atom feed
* sparse missing bitwise warnings with dubious bitfields
@ 2007-06-08  8:24 Johannes Berg
  2007-06-08 13:19 ` Al Viro
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2007-06-08  8:24 UTC (permalink / raw)
  To: linux-sparse; +Cc: Michael Wu, Christoph Hellwig

[-- Attachment #1: Type: text/plain, Size: 689 bytes --]

Hi,

Not sure if this is intended but it is surely quite weird. Take the
following code:

--- begin code ---
#ifdef DUBIOUS
struct {  
  int x:1;
};
#endif

typedef unsigned short __attribute__((bitwise)) __le32;

int main(int argc, char **argv)
{
  __le32 i = 5;
}
--- end code ---

and save it as test.c, and then observe:

$ sparse test.c
test.c:11:14: warning: incorrect type in initializer (different base types)
test.c:11:14:    expected restricted unsigned short [usertype] i
test.c:11:14:    got int 

$ sparse test.c -DDUBIOUS
test.c:3:10: error: dubious one-bit signed bitfield

[note that no warning about the bitwise error is there!]

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

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

* Re: sparse missing bitwise warnings with dubious bitfields
  2007-06-08  8:24 sparse missing bitwise warnings with dubious bitfields Johannes Berg
@ 2007-06-08 13:19 ` Al Viro
  0 siblings, 0 replies; 2+ messages in thread
From: Al Viro @ 2007-06-08 13:19 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-sparse, Michael Wu, Christoph Hellwig

On Fri, Jun 08, 2007 at 10:24:10AM +0200, Johannes Berg wrote:
> $ sparse test.c -DDUBIOUS
> test.c:3:10: error: dubious one-bit signed bitfield
> 
> [note that no warning about the bitwise error is there!]

... or any other warnings, for that matter.

Error turns the warnings off.

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

end of thread, other threads:[~2007-06-08 13:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-08  8:24 sparse missing bitwise warnings with dubious bitfields Johannes Berg
2007-06-08 13:19 ` Al Viro

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