public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steve Kemp <steve@steve.org.uk>
To: linux-kernel@vger.kernel.org
Subject: trivial patches: Should we care about control reaches end of non-void function
Date: Wed, 15 Oct 2008 19:07:32 +0100	[thread overview]
Message-ID: <20081015180732.GA4119@steve.org.uk> (raw)

  During my build processes I see a lot of messages like this:

  In function xxx:
 xxx.c:123: control reaches end of non-void function

  These are typically caused by constructs like:

    static int some_function()
    {
        switch (blah) {
        ...

        default:
            BUG();
        }
    }

  I see some functions in the kernel have added "return 0" after the
 BUG, presumably to silence these warnings.  Would a patch to do this
 consistently, or is that too trivial even for trivial patches?

  Actual example:
    ./mm/mempolicy.c
        policy_zonelist - gives this warning.
        slab_node       - gives this warning
        __mpol_equal    - has the warning silenced via explicit return.

Steve
-- 
Managed Anti-Spam Service
http://mail-scanning.com/


             reply	other threads:[~2008-10-15 18:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-15 18:07 Steve Kemp [this message]
2008-10-15 21:33 ` [PATCH] compiler warning cleanup Steve Kemp
2008-10-15 22:26 ` trivial patches: Should we care about control reaches end of non-void function Alan Cox
2008-10-16  6:08   ` Steve Kemp

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=20081015180732.GA4119@steve.org.uk \
    --to=steve@steve.org.uk \
    --cc=linux-kernel@vger.kernel.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