New and bogus(!) warning produced by sparse.

From: Anton Altaparmakov (aia21_at_cam.ac.uk)
Date: 09/30/05

  • Next message: Luben Tuikov: "Re: I request inclusion of SAS Transport Layer and AIC-94xx into the kernel"
    Date:	Fri, 30 Sep 2005 15:03:08 +0100 (BST)
    To: Linus Torvalds <torvalds@osdl.org>
    
    

    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/
    

  • Next message: Luben Tuikov: "Re: I request inclusion of SAS Transport Layer and AIC-94xx into the kernel"

    Relevant Pages

    • Re: Possible dcache BUG
      ... During the compile, the above line output this warning: ... Copyright 2004 by Maurice Eugene Heskett, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • PROBLEM: make menuconfig command with kernel 2.6.4
      ... Is this a problem of my system or a kernel/compiler bug?! ... Here the output of my bash: ... scripts/basic/fixdep.c:193: warning: unused variable `s' ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: + shut-up-warnings-in-ipc-shmc.patch added to -mm tree
      ... > warning. ... I'm with Matt on the typechecking here, and at first liked his proposal; ... they're turning out to be real pigs instead. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: question about module and undeinfed symbols.
      ... I think the problem is isolated, I notices that System.map doesnt ... A warning appear during kernel compilation, ... parameter names in function declaration ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.6.12-rc5-mm1 - missing #define SECTIONS_SHIFT in sparsemem
      ... > define when SPARSEMEM is off. ... You only see the warning if you add ... I'll send the .config privately in a separate message. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)