From: Johannes Weiner <hannes@saeurebad.de>
To: kernel-janitors@vger.kernel.org
Subject: Re: How to fix warning 'control reaches end of non-void function'
Date: Tue, 29 Jul 2008 20:51:03 +0000 [thread overview]
Message-ID: <87fxpsct3c.fsf@saeurebad.de> (raw)
In-Reply-To: <20080729191738.GA32506@orion>
Hi,
Alexander Beregalov <a.beregalov@gmail.com> writes:
> Hi
>
> What is it a right way to fix these warnings?
>
> smth function()
> {
> switch (var) {
> case one:
> return 1;
> default:
> BUG();
> }
> }
>
> warning: control reaches end of non-void function
Uhm, make sure there is always a value returned...? You don't do that
when var is not one.
Hannes
next prev parent reply other threads:[~2008-07-29 20:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-29 19:17 How to fix warning 'control reaches end of non-void function' Alexander Beregalov
2008-07-29 20:48 ` Daniel Baluta
2008-07-29 20:51 ` Johannes Weiner [this message]
2008-07-29 21:02 ` Marcin Slusarz
2008-07-29 21:20 ` Johannes Weiner
2008-07-29 22:38 ` Rene Herman
2008-07-29 23:15 ` Jacob
2008-07-29 23:27 ` Alexander Beregalov
2008-07-30 8:34 ` Sandeep K Sinha
2008-07-30 12:40 ` Hugo Vasconcelos Saldanha
2008-07-30 15:57 ` walter harms
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=87fxpsct3c.fsf@saeurebad.de \
--to=hannes@saeurebad.de \
--cc=kernel-janitors@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.