lkml.org 
[lkml]   [2008]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] sched: add statics, don't return void expressions
From
Date
On Fri, 2008-04-25 at 14:17 +0200, Peter Zijlstra wrote:
> On Thu, 2008-04-24 at 18:17 -0700, Harvey Harrison wrote:
> > Noticed by sparse:
> > kernel/sched.c:760:20: warning: symbol 'sched_feat_names' was not declared. Should it be static?
> > kernel/sched.c:767:5: warning: symbol 'sched_feat_open' was not declared. Should it be static?
> > kernel/sched_fair.c:845:3: warning: returning void-valued expression
> > kernel/sched.c:4386:3: warning: returning void-valued expression
>
> I'm still of two minds about that latter warning, I think:
>
> void foo(void);
>
> void bar(void)
> {
> return foo();
> }
>
> isn't wrong, as the return types match.
>

True it's not wrong, but it is a trivial way to reduce the sparse noise
somewhat which can make it harder to see real bugs. Just like the
integer used as NULL pointer warnings.

And even though in this case, I can't see the return type changing to
actually return something, coding it this way makes it obvious if you
ever missed a return site.

No strong feelings.

Harvey



\
 
 \ /
  Last update: 2008-04-25 19:59    [W:0.111 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site