> >I also agree but I remember at one point we got pushback from > >one of the mainline kernel developers who really wanted to see > >only one return point in the code even if it meant more gotos. > >I don't remember who though. > > I think the coding style document calls out using a single return point, but > I > don't think that's always the cleanest approach either.
CodingStyle suggests using goto to avoid duplicating cleaup code at every return. I don't think anyone would argue in favor of the style we're talking about here of using goto to jump to a plain return statement. it doesn't help avoid bugs caused by missing cleanup, and it actually *causes* bugs like the one here where it becomes easy to forget what the function is returning. - R. _______________________________________________ general mailing list [email protected] http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
