mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jesper Juhl" <jesper.juhl@gmail.com>
To: "Horst H. von Brand" <vonbrand@inf.utfsm.cl>
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: Tue, 12 Sep 2006 10:59:46 +0200	[thread overview]
Message-ID: <9a8748490609120159s28968daco6e4312d141046f25@mail.gmail.com> (raw)
In-Reply-To: <200609112256.k8BMuqVt006467@laptop13.inf.utfsm.cl>

On 12/09/06, Horst H. von Brand <vonbrand@inf.utfsm.cl> wrote:
> Jesper Juhl <jesper.juhl@gmail.com> 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
>
> It is an infinite loop...

I know. I'm just trying to get gcc to shut up.


> >                                                                     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().
>
> How about marking it as never returning?

Marking it NORET_TYPE doesn't do the trick, adding a 'return 0;' does.
And gcc optimizes the return away anyway, so the object file doesn't
increase in size, so it does no harm.

-- 
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

      reply	other threads:[~2006-09-12  8:59 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
2006-09-11 20:23     ` Dave Jones
2006-09-11 22:56 ` Horst H. von Brand
2006-09-12  8:59   ` Jesper Juhl [this message]

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=9a8748490609120159s28968daco6e4312d141046f25@mail.gmail.com \
    --to=jesper.juhl@gmail.com \
    --cc=faith@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vonbrand@inf.utfsm.cl \
    /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®