login
Header Space

 
 

Re: [PATCH 09/10] misc: fix returning void-valued expression warnings

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Harvey Harrison <harvey.harrison@...>
Cc: Andrew Morton <akpm@...>, LKML <linux-kernel@...>, Peter Zijlstra <a.p.zijlstra@...>
Date: Thursday, May 1, 2008 - 7:43 am

On Thu, May 01 2008 at 1:03 +0300, Harvey Harrison <harvey.harrison@gmail.com> wrote:

I don't know who invented sparse, but I like this form of return.
1 - It saves me the curly brackets and extra return line. But mainly
2 - It is a programing statement that says: "Me here I'm an equivalent 
  to that other call". So if in the future that inner function starts
  to return, say, an error value, with the first style the compiler will
  error. But with the second style the new error return will be silently
  ignored. So these are not equivalent replacements. The former is a much
  stronger bond between the caller and the callie.


Even without the saving in the if case, I would say fix sparse, it is
very very wrong. a return (void)do(); is not equal to do(); return;

Code is not only high level assembly, it is also a low level English.
In English the first form is telling what the future assembly should
be.

big NACK from me (== $0.02)

Boaz

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 09/10] misc: fix returning void-valued expression..., Boaz Harrosh, (Thu May 1, 7:43 am)
speck-geostationary