mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Dooks <ben@fluff.org.uk>
To: Linus Torvalds <torvalds@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers/base - fix sparse warnings
Date: Thu, 13 Oct 2005 19:24:31 +0100	[thread overview]
Message-ID: <20051013182431.GA2155@home.fluff.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0510131059510.15297@g5.osdl.org>

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'

  parent reply	other threads:[~2005-10-13 18:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-13 16:54 Ben Dooks
2005-10-13 18:10 ` Linus Torvalds
2005-10-13 18:21   ` Russell King
2005-10-13 18:46     ` Linus Torvalds
2005-10-13 18:24   ` Ben Dooks [this message]
2005-10-28  6:30 [PATCH] INPUT: Create symlinks for backwards compatibility Greg KH
2005-10-28  6:30 ` [PATCH] drivers/base - fix sparse warnings Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051013182431.GA2155@home.fluff.org \
    --to=ben@fluff.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome