From: "Jesper Juhl" <jesper.juhl@gmail.com>
To: "Dave Jones" <davej@redhat.com>,
"Jesper Juhl" <jesper.juhl@gmail.com>,
linux-kernel@vger.kernel.org, "Rickard Faith" <faith@redhat.com>
Subject: Re: [PATCH] fix warning: no return statement in function returning non-void in kernel/audit.c
Date: Mon, 11 Sep 2006 21:22:15 +0200 [thread overview]
Message-ID: <9a8748490609111222w2dd313e3hc64cb36bca7f646a@mail.gmail.com> (raw)
In-Reply-To: <20060911160328.GJ4743@redhat.com>
On 11/09/06, Dave Jones <davej@redhat.com> wrote:
> On Mon, Sep 11, 2006 at 05:15:16PM +0200, Jesper Juhl wrote:
> >
> > kauditd_thread() is being used in a call to kthread_run(). kthread_run() expects
> > a function returning 'int' which is also how kauditd_thread() is declared. Unfortunately
> > kauditd_thread() neglects to return a value which results in this complaint from gcc :
> >
> > kernel/audit.c:372: warning: no return statement in function returning non-void
> >
> > Easily fixed by just adding a 'return 0;' to kauditd_thread().
>
> Which will never be reached.
True, and gcc even seems to optimize it out, since the size of audit.o
doesn't change with the patch applied... So, it does no harm and it
silences the warning - so why not?
I guess one could add a small /* never reached */ comment...
> Does marking the function NORET_TYPE
> also silence the warning?
>
Nope :(
This is with gcc 4.1.1 btw.
--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
next prev parent reply other threads:[~2006-09-11 19:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-11 15:15 Jesper Juhl
2006-09-11 16:03 ` Dave Jones
2006-09-11 19:22 ` Jesper Juhl [this message]
2006-09-11 20:23 ` Dave Jones
2006-09-11 22:56 ` Horst H. von Brand
2006-09-12 8:59 ` Jesper Juhl
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=9a8748490609111222w2dd313e3hc64cb36bca7f646a@mail.gmail.com \
--to=jesper.juhl@gmail.com \
--cc=davej@redhat.com \
--cc=faith@redhat.com \
--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
all inboxes | Powered by JetHome®