lkml.org 
[lkml]   [2005]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] drivers/base - fix sparse warnings
On Thu, Oct 13, 2005 at 11:10:15AM -0700, Linus Torvalds wrote:
>
>
> On Thu, 13 Oct 2005, Ben Dooks wrote:
> >
> > The patch does not solve all the sparse errors generated,
> > but reduces the count significantly.
>
> Well, you should also then remove the _bad_ declarations.

Sorry, I do not follow you, can you clarify this for me.
My patch did not generate any more errors, just removed the ones
that where easy to see a solution too.

> For example, attribute_container_init() right now is defined in
> attribute_container.c, but then it's _declared_ (with no checking) where
> it's used in init.c.
>
> The sparse warnign is appropriate: it was not declared where that
> declaration is actually visible to the definition, so the code basically
> isn't type-safe at all (since there's nothing that enforces the
> declaration actually matching the definition).
>
> You made the declaration properly visible, but you should also remove the
> bogus declaration. A declaration that isn't visible to the definition is
> always bad - since in the absense of a compiler with global visibility it
> may or may not actually match what it supposedly declares.
>
> I wonder if I should make sparse warn about multiple declarations..

I pulled the old declerations out of drivers/base/init.c ? I'm sure
the patch shows that?

--
Ben (ben@fluff.org, http://www.fluff.org/)

'a smiley only costs 4 bytes'
-
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/

\
 
 \ /
  Last update: 2005-10-13 20:27    [W:0.037 / U:0.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site