Re: [PATCH 2/2] Use any previous initializer to size a symbol

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Mar 30, 2014 at 10:22 AM, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> From: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> Date: Sun, 30 Mar 2014 10:13:54 -0700
> Subject: [PATCH 2/2] Use any previous initializer to size a symbol
>
> When we size a symbol, we only have one initializer per symbol, but we
> may have multiple symbol declarations for the same symbol.  So make sure
> to walk the "same_symbol" chain to find the initializer, rather than
> assuming it is attached to the current declaration.
>
> Reported-by: Hans Verkuil <hverkuil@xxxxxxxxx>
> Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>

This patch looks good to me. Will apply.


> ---
>
> This seems to be the simplest approach. Chris, what was your concern about
> scoping? The "same_symbol" list should already take scoping into account.


This bug is a special case of the more general sparse bug in merging
declaration types.

The scoping I am concern about is some thing like this:
(BTW, your patch does not have the scoping issue).

extern void foo(void) __attribute__((X));
for (;;) {
    extern void foo(void) __attribute__((Y));
    /* function foo()  should have both attribute X and Y here */

}

/* foo() should have only attribute X here */

Merging the initializer is a special case of this more general
bug. Obviously, this patch fix the merging of initialization,  should
be applied.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux