On Thu, 2009-05-28 at 11:46 +0200, Cyril Hrubis wrote: > Any comment on this? > > ----- Forwarded message from Cyril Hrubis <[email protected]> ----- > > Date: Fri, 22 May 2009 21:30:21 +0200 > From: Cyril Hrubis <[email protected]> > To: Subrata Modak <[email protected]> > Cc: [email protected] > Subject: Re: [LTP] [PATCH] fix missing return in several files. > In-Reply-To: <[email protected]> > User-Agent: Mutt/1.5.17 (2007-11-01) > > > > Well it breaks building suse rpm package as buildservice system treats > > > these > > > kind of warning as errors and it's IMHO harmless to add these returns in > > > the code. > > > > Strange. But, in LTP convention, tst_exit() is used which in turn does a > > return $EXIT_CODE on it?? own. We do not interfere. return 0/1 exists in > > LTP code only when we have not detected that, or, it has been lying > > there old. Else, for new tests and when submitting patches we convert > > all returns to tst_exit(). > > Yes tst_exit calls exit() call which does some magick that terminates running > process and returns value passed to that function. So the code iself is > correct. But compiler is not smart enough to see that. And as indirect call to > exit() is only situation I'm aware of where missing return is not a bug, it's > not so dumb to treat this kind of warning as error. And some buildsystems does > so. > > > There are several possibilities that can avoid this kind of problem. > > a) Add return 0, to those main() functions to make buildsystem happy. That's > perfectly harmless as the code never gets makes it to this return 0; But > it's > not clean solution anyway. > > b) Add tst_exitval() function that do the same as tst_exit but instead of > exiting > returns value passed to exit() call. So the code would look like: > > return tst_exitval();
Try to implement this ;-) Regards-- Subrata > > c) Leave it this way and force people who are doing packages to patch all > these > files on their own. > > -- > Cyril Hrubis > [email protected] > > ----- End forwarded message ----- > ------------------------------------------------------------------------------ Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp as they present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
