RE: [PATCH v2 2/5] ipset: add "inner" flag implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 27 Jun 2013, Jeff Haran wrote:

> ...
> > I disagree. By having "return false" (or "return 0", "return -1" and so
> > on) instead of "goto err" it is not immediately apparent to someone who
> > studies/reviews/uses the code that this is an error condition/path. I
> > have been in that situation many times when I have to go back and look
> > at a particular function call to see what "return false" or "return 0"
> > actually means.
> > 
> > By including "goto err" instead of multiple "return false" statement,
> > that makes it instantly obvious what the purpose of that statement is
> > without having to look elsewhere.
> 
> I suppose as an alternative you could go way against the usual practice 
> and put some text in a function header comment block indicating what the 
> return code means. I know it doesn't get used much but C has had this /* 
> comment */ thing for a long time. I've never understood why more people 
> don't use it.

In general I'd agree with you, but this is a boolean function. So why 
should the the meaning of the return value "true" and "false" be 
explained? (This is also why I regard the goto unnecessary.)

Best regards,
Jozsef
-
E-mail  : kadlec@xxxxxxxxxxxxxxxxx, kadlecsik.jozsef@xxxxxxxxxxxxx
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences
          H-1525 Budapest 114, POB. 49, Hungary
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux