From: Linus Torvalds <torvalds@osdl.org>
To: Chris Wright <chrisw@osdl.org>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org,
Mika Kukkonen <mika@osdl.org>
Subject: Re: [PATCH] security_sk_free void return fixup
Date: Tue, 15 Jun 2004 19:53:28 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.58.0406151946220.4142@ppc970.osdl.org> (raw)
In-Reply-To: <20040615161646.S21045@build.pdx.osdl.net>
On Tue, 15 Jun 2004, Chris Wright wrote:
>
> CHECK net/core/sock.c
> include/linux/security.h:2636:39: warning: return expression in void function
> CC net/core/sock.o
I'm going to remove this warning from sparse. Apparently it is valid C99,
and somebody (I think Richard Henderson) made the excellent point that it
allows for type-independent code where you do something like
mytype myfunc1(xxx);
mytype myfunc2(xxx)
{
...
return myfunc1(...);
}
and it just works regardless of what type it is.
sparse will obviously warn about expressions with non-void types being
returned from a void function, but the case where the expression exists
and has the right type should be ok.
I'm not sure it's wonderful C in general, but I certainly can't claim it
is actively offensive, and since gcc accepts it and we have these things
in the kernel, why complain?
Linus
next prev parent reply other threads:[~2004-06-16 3:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-15 23:16 Chris Wright
2004-06-16 2:53 ` Linus Torvalds [this message]
2004-06-16 3:00 ` Andrew Morton
2004-06-16 3:04 ` Linus Torvalds
2004-06-16 12:11 ` Dick Streefland
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=Pine.LNX.4.58.0406151946220.4142@ppc970.osdl.org \
--to=torvalds@osdl.org \
--cc=akpm@osdl.org \
--cc=chrisw@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika@osdl.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®