lkml.org 
[lkml]   [2004]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] security_sk_free void return fixup


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

\
 
 \ /
  Last update: 2009-11-18 23:46    [W:0.033 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site