[comp.sys.atari.st] GCC/RTX problem solved?

david@doe.utoronto.ca (David Megginson) (10/02/90)

I had a chance (finally) to look at the GCC library source for the
Atari ST version (actually, it was the source with Eric's mods for
MiNT). I think that I have found the problem with running GCC under
Micro RTX, and it is not (really) RTX's fault.

freopen() in the GCC library closes the previous file handle so that
it can re-use the structure. If that handle is 0 or 1 (ie. standard
input or output), RTX probably returns an error code where TOS
doesn't. I have not seen the source for gcc-cpp.ttp, but I imagine
that it attempts to freopen() stdout for its output file, and that's
why it doesn't work under RTX. Since closing handles 0 or 1 is a
flakey practice at best, I'd call this a GCC bug rather than an RTX
bug, although DB might want to patch up RTX anyway. To fix the GCC`
library, just do an isatty() on the handle before closing it -- or
better yet, _never_ close the standard handles (it might confuse the
shell).


(a much relieved) David Megginson

-- 
////////////////////////////////////////////////////////////////////////
/  David Megginson                      david@doe.utoronto.ca          /
/  Centre for Medieval Studies          meggin@vm.epas.utoronto.ca     /
////////////////////////////////////////////////////////////////////////