mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* New and bogus(!) warning produced by sparse.
@ 2005-09-30 14:03 Anton Altaparmakov
  2005-09-30 14:29 ` Linus Torvalds
  0 siblings, 1 reply; 5+ messages in thread
From: Anton Altaparmakov @ 2005-09-30 14:03 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel

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;
}

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

end of thread, other threads:[~2005-09-30 15:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-30 14:03 New and bogus(!) warning produced by sparse Anton Altaparmakov
2005-09-30 14:29 ` Linus Torvalds
2005-09-30 14:34   ` Linus Torvalds
2005-09-30 15:37   ` Linus Torvalds
2005-09-30 15:48     ` Anton Altaparmakov

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

all inboxes | Powered by JetHome®