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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: David Miller
Date: Wednesday, April 30, 2008 - 3: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 expressio ..., David Miller, (Wed Apr 30, 3:08 pm)