New and bogus(!) warning produced by sparse.

From: Anton Altaparmakov
Date: Fri Sep 30 2005 - 09:03:47 EST


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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/