public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: Jesper Juhl <jesper.juhl@gmail.com>
Cc: 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 16:23:44 -0400	[thread overview]
Message-ID: <20060911202344.GB18548@redhat.com> (raw)
In-Reply-To: <9a8748490609111222w2dd313e3hc64cb36bca7f646a@mail.gmail.com>

On Mon, Sep 11, 2006 at 09:22:15PM +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?

Ah well, works for me :)

 > I guess one could add a small /* never reached */ comment...

Could do for completeness, though it should seem fairly obvious.

 > > Does marking the function NORET_TYPE
 > > also silence the warning?
 > Nope :(

Bah!

	Dave


  reply	other threads:[~2006-09-11 20:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-11 15:15 [PATCH] fix warning: no return statement in function returning non-void in kernel/audit.c Jesper Juhl
2006-09-11 16:03 ` Dave Jones
2006-09-11 19:22   ` Jesper Juhl
2006-09-11 20:23     ` Dave Jones [this message]
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=20060911202344.GB18548@redhat.com \
    --to=davej@redhat.com \
    --cc=faith@redhat.com \
    --cc=jesper.juhl@gmail.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