> As suggested by deraadt@ and tobias@ it might be better to use the
> *return* statement instead of exit(3) 
> inside the *main* function, to let the stack protector do its work.
> 
> This diff removes such calls in all *src/bin/* tools, except those
> who already use it.  I think I didn't miss a call and didn't introduce
> any bugs.

So there is a downside.

In a more complex program with a large main() function, a call to
exit() is an explicit statement about termination, so that even if
someone refactors code to a subfunction, they must consider that
it carefully.

The return is not as explicit.

Now that you have done a few, please go review them and think about
that side.  Perhaps think about it in regarding larger programs;
the ones in bin tend to be very small.

libexec is a good area to come to the realization that firm rules
don't always result in an improvement.

Reply via email to