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

login
register
mail settings
Submitter Hans-Peter Nilsson
Date Oct. 21, 2012, 1:04 p.m.
Message ID <alpine.BSF.2.00.1210210900170.50139@dair.pair.com>
Download mbox | patch
Permalink /patch/192995/
State New
Headers show

Comments

Hans-Peter Nilsson - Oct. 21, 2012, 1:04 p.m.
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
Andreas Schwab - Oct. 21, 2012, 1:19 p.m.
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.
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

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);
 }