> > 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(); c) Leave it this way and force people who are doing packages to patch all these files on their own. -- Cyril Hrubis [email protected] ------------------------------------------------------------------------------ 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 asthey present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://www.creativitycat.com _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
