Re: [PATCH] CRED: fix sparse warnings

From: Hannes Eder
Date: Mon Nov 24 2008 - 19:46:20 EST


On Tue, Nov 25, 2008 at 12:21 AM, David Howells <dhowells@xxxxxxxxxx> wrote:
> Hannes Eder <hannes@xxxxxxxxxxxxxx> wrote:
>
>> security/security.c:228:2: warning: returning void-valued expression
>> security/security.c:233:2: warning: returning void-valued expression
>> security/security.c:616:2: warning: returning void-valued expression
>
> What's wrong with that?

In my opinion the following quotes give good argument:

> On Thu, 2008-05-01 at 13:00 +0100, Al Viro wrote:
[snip|
> > 3. 6.8.6.4(1): A return statement with an expression shall not appear in
> > a function whose return type is void.
> >
> > Write in C, please.

see http://lkml.org/lkml/2008/5/1/88

On Thu, 1 May 2008 at 13:53:39 +0100, Al Viro wrote:
> On Thu, May 01, 2008 at 03:42:14PM +0300, Boaz Harrosh wrote:
> > > 3. 6.8.6.4(1): A return statement with an expression shall not appear in
> > > a function whose return type is void.
> > >
> >
> > Please forgive my ignorance, where is this quote from?
>
> C99. I don't have C90 in front of me, so I can't give you exact quote from
> there, but it's been explicitly banned in C90 as well.

see http://lkml.org/lkml/2008/5/1/112

There have been a couple of such patches, see

http://www.google.at/search?q=site:lkml.org+%22warning:+returning+void-valued+expression%22

Furthermore in the next-tree from today and 'defconfig' are only 5 of
such warnings left, 3 of them would be resolved with this patch.

Hannes
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/