lkml.org 
[lkml]   [2005]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectNew and bogus(!) warning produced by sparse.
Hi Linus,

I just did a git pull on sparse and it produced a new and I believe
bogus warning when trying to assign a value to a bit field member. The
warning is:

warning: generating address of non-lvalue (1)

Below is an example program that triggers the warning when you run:

sparse sparse-test.c

Best regards,

Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/

--- sparse-test.c ---

int main(void)
{
struct {
unsigned bit1:1;
unsigned bit2:1;
} bits = { 0, 0 };

bits.bit1 = 1; /* sparse warns here! */
bits.bit2 = 0; /* sparse warns here! */
return 0;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-09-30 16:06    [W:0.446 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site