diff mbox

Committed: fix gcc.dg/webizer.c (the trivial part :)

Message ID alpine.BSF.2.00.1210210900170.50139@dair.pair.com
State New
Headers show

Commit Message

Hans-Peter Nilsson Oct. 21, 2012, 1:04 p.m. UTC
Committed as obvious.  Without this, mmix-knuth-mmixware exited with
2256, likely a return-address left over in the return-value-register.
I used __builtin_exit just to avoid declarations or includes; the
default implicit declaration apparently incompatible with this use.
I saw nothing in the related conversation thread that this was
anything but an oversight.  Of course this might have caused an
unintended failure mistaken for a valid test-case, but Occam says
that's overthinking.

testsuite:
	* gcc.dg/webizer.c (main): Add missing exit call.


brgds, H-P

Comments

Andreas Schwab Oct. 21, 2012, 1:19 p.m. UTC | #1
Hans-Peter Nilsson <hp@bitrange.com> writes:

> I used __builtin_exit just to avoid declarations or includes;

A "return 0" would have worked just as well.

Andreas.
Hans-Peter Nilsson Oct. 21, 2012, 1:46 p.m. UTC | #2
On Sun, 21 Oct 2012, Andreas Schwab wrote:
> Hans-Peter Nilsson <hp@bitrange.com> writes:
>
> > I used __builtin_exit just to avoid declarations or includes;
>
> A "return 0" would have worked just as well.

It's not the preferred method.  Fail: abort().  Pass: exit(0).
Don't remember where I read it, though.

Brgds, H-P
diff mbox

Patch

Index: gcc.dg/webizer.c
===================================================================
--- gcc.dg/webizer.c	(revision 192651)
+++ gcc.dg/webizer.c	(working copy)
@@ -32,4 +32,5 @@  configure2()
 main()
 {
   configure2();
+  __builtin_exit (0);
 }