On Sat, 15 Jan 2005, Sam Ravnborg wrote:
>
> In several cases sparse complains about:
> invalid access pastthe end of 'xxx'
>
> Examples are in arch/i386/kernel/signal.c, ioport.c
> The warning is correct but a bit annoying.
Hmm.. I actually added the warning after we had a bug where that warning
would have saved us. So the warning literally does show bugs, and I think
it's very valid.
And there _are_ ways of annotating it properly:
> The following code snippet make sparse emit the same warning:
>
> struct big
> {
> long a;
> long b;
> };
>
> struct big fun(long a)
> {
> struct big *p = (struct big *) &a;
> return *p;
> }
>
> The pattern above is used to play tricks with the stack frame - so the
> code in question is OK and the warning is correct.
> Are there any way to quiet sparse without uglifying the code (too much)?
You can fix it by hiding the pointer, the same way we do RELOC_HIDE() in
<linux/compiler-gcc.h>. For basically the same reasons - gcc does
something similar for static symbols only.
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html