Frustrated trying to be portable

John F Haugh II jfh at rpp386.cactus.org
Mon Mar 4 05:58:06 AEST 1991


In article <4204 at lupine.NCD.COM> rfg at NCD.COM (Ron Guilmette) writes:
>In article <15333 at smoke.brl.mil> gwyn at smoke.brl.mil (Doug Gwyn) writes:
>+It isn't necessary.  If the application requires library functions
>+that are required for a hosted implementation but not for a
>+freestanding implementation, then it couldn't survive being told
>+that it is being compiled by a freestanding implementation anyway.
>
>I think that you have just assumed away a very real problem.
>
>Look.  I have a program which can work, and which can do useful things
>even within an environment which only conforms to "standalone" subset
>of ANSI C.

I have to side with Ron on this one.  Doug is making the assumption
that the functions =must= exist for the program to be executed.  Yet
there were quite a few commands, such as 'ls', which have traditionally
been compiled "standalone" and "hosted" that managed to function quite
well long before the arrival of ANSI C.  Anyone with access to the old
source to "ls" can go see for themselves what I am talking about.

The standalone C library provided a great many functions which also
existed in the "real" C library, yet many, such as "getpid()", were
little more than stubs.  I've not compiled a standalone anything in a
while, but as I recall, the standalone C compiler defined the macro
"STANDALONE" when it was being used.
-- 
John F. Haugh II        | Distribution to  | UUCP: ...!cs.utexas.edu!rpp386!jfh
Ma Bell: (512) 832-8832 | GEnie PROHIBITED :-) |  Domain: jfh at rpp386.cactus.org
"I've never written a device driver, but I have written a device driver manual"
                -- Robert Hartman, IDE Corp.



More information about the Comp.std.c mailing list