All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesse Millan <jessem@cs.pdx.edu>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] Re: GCC4 warning: no return statement in function returning
Date: Thu, 07 Jul 2005 21:14:13 +0000	[thread overview]
Message-ID: <42CD9B25.7050706@cs.pdx.edu> (raw)
In-Reply-To: <20050701221504.GA26388@homer.coderock.org>



randy_dunlap wrote:
> On Sat, 2 Jul 2005 00:22:51 +0200 Domen Puncer wrote:
> 
> | On 02/07/05 00:15 +0200, Domen Puncer wrote:
> | > On 01/07/05 11:19 -0700, Jesse Millan wrote:
> | > > -int kauditd_thread(void *dummy)
> | > > +void kauditd_thread(void *dummy)
> | > 
> | > This should warn too, as kthread_create() (kthread_run()) accepts
> | > int (*threadfn)(void *data)
> | > 
> | > I think kauditd_thread() should be fixed here to return something...
> | > "The return value should be zero or a negative error number:
> | >  it will be passed to kthread_stop()."
> | 
> | But it doesn't return at all (d'oh, should have seen this before).
> | Still... there's a warning if it returns void, right?
> 
> so it needs 
>   __attribute__((noreturn))
> added to the function?
> (or ATTRIB_NORET)
> 
> ---
> ~Randy
> 

Using the noreturn attribute implies to me that the return type should
be void. That can't be because kthread_run() expects a pointer to a
function that returns an int. Any return statement after the while(1) is
unreacable as Domen pointed out...

Could you clarify what needs to be done?

-- 
Jesse Millan
CNS Unix Team
Portland State University
Phone: (503) 725-9151
Mobile: (503) 453-0748
GPG key: www.system-calls.com/gpg.php

grep --recursive --ignore-case 'SHOULD WORK' /usr/src/linux/* | wc
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

  parent reply	other threads:[~2005-07-07 21:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-01 22:15 [KJ] Re: GCC4 warning: no return statement in function returning Domen Puncer
2005-07-01 22:22 ` Domen Puncer
2005-07-01 22:42 ` [KJ] Re: GCC4 warning: no return statement in function randy_dunlap
2005-07-01 22:59 ` [KJ] Re: GCC4 warning: no return statement in function returning Jesse Millan
2005-07-07 21:14 ` Jesse Millan [this message]
2005-07-08 18:21 ` [KJ] Re: GCC4 warning: no return statement in function randy_dunlap

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=42CD9B25.7050706@cs.pdx.edu \
    --to=jessem@cs.pdx.edu \
    --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.