[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: systems requiring exit?

From: Harlan Stenn
Subject: Re: systems requiring exit?
Date: Tue, 07 Nov 2006 21:11:14 +0000

> > A reasonable solution would be standard tests as described above:
> > whether the argument to `return' in `main' is ignored, and, if yes,
> > how to call `exit' properly.
> Yes, something like that would be reasonable, if someone could take
> the time to write it, and (more important) test it on the ancient
> systems where returning a nonzero value from 'main' doesn't conform to
> the C89 standard.

It may be reasonable to handle this on a per-case basis.

For example I am only just now about to deprecate K&R support for NTP.

> > not even any detailed
> > description of how that broken `return' would behave to test for,
> As I recall, SCO 2.3.1 (1989) had a bug where "main () { return 0; }"
> exited with status 1.
> Conversely, in older SunOS versions -- I believe it was SunOS 2.0
> (1985) through 3.5 (1988) -- "main () { return 1; }" exited with
> status 0.

If it was me, I'd be inclined to test the host-triple and come up with
something that way.

And if it came down to it, change from looking at the exit status to
looking at, say, something written to stdout (or an output file).

> > Have no systems with broken `return' at hand,
> That's the fundamental problem.  These systems are _ancient_ -- they
> all predate C89 -- and they are so old that nobody uses them any more.

Almost.  But they do seem to be going away.

I am still getting pushback from folks who want NTP to work on ancient
boxes.  I ask them if they are willing to pay to keep the code working
and the answer has so far been "no".


reply via email to

[Prev in Thread] Current Thread [Next in Thread]