This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Off-by-one errors in gcc/config/arm/pr-support.c
On Thu, 2006-08-17 at 21:49, Mark Mitchell wrote:
> Richard Earnshaw wrote:
> > Ok, except that your testcase should call abort() on failure (it
> > currently returns 1 from main. See other testcases in the same
> > subdirectory for examples.
> I'm equally happy with either convention, but is there a reason to
> prefer abort? I've preferred returning a non-zero exit status, on the
> grounds that abort might cause a core dump, which might be slow. Since
> we require libgloss tricks for systems where you can't get the exit
> status, I thought returning a non-zero exit status was OK. Is that not
> the case?
This is just one of my 'remembered wisdoms'. I can't recall the
arguments behind it. It might be related to platforms where
EXIT_SUCCESS isn't defined to be zero (wasn't VMS one such beast?), so
having testcases fail by calling abort made it clear that the test had
It's also sometimes easier to debug testcases in a debugger if you use
abort, since you can then set a breakpoint on that and catch the program
while it still has some state -- once you've returned from main
everything is gone.
So, nothing concrete, but a number of small reasons.