login
Header Space

 
 

Re: [PATCH 07/10] net: fix returning void-valued expression warnings

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <harvey.harrison@...>
Cc: <akpm@...>, <jeff@...>, <linux-kernel@...>
Date: Wednesday, April 30, 2008 - 6:08 pm

From: Harvey Harrison <harvey.harrison@gmail.com>
Date: Wed, 30 Apr 2008 15:03:43 -0700


I wish this weren't marked with a warning, what spits this out,
sparse?

I know the kernel is written in C and not C++, but even Stroustrup
mentions this case explicitly in his book:

	 A void function cannot return a value.  However, a call of a
	 void function doesn't yield a value, so a void function can
	 use a call of a void function as the expression in a return
	 statement.

And I see no reason why there's anything wrong with this construct.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 07/10] net: fix returning void-valued expression ..., David Miller, (Wed Apr 30, 6:08 pm)
speck-geostationary