Frustrated trying to be portable

John F Haugh II jfh at rpp386.cactus.org
Tue Mar 5 23:41:54 AEST 1991


In article <15382 at smoke.brl.mil> gwyn at smoke.brl.mil (Doug Gwyn) writes:
>In fact I am well aware of AT&T's "standalone" mode for a few commands
>such as "ls", and how they are used.  On the other hand, I don't think
>you have thought this matter through very well.  If you have an
>application that performs useful work in a "freestanding" C environment,
>it must directly access hardware registers or be linked with some
>nonstandard support library in order to perform I/O etc.  Obviously this
>would not be a portable application.  Being nonportable, it can and
>would take advantage of system-specific support.  There is nothing to
>keep you from using such "hosted" functions as can be made to work in
>such an environment.  You don't need to key on any implementation-
>provided macro for this, either.

Sure you do.  How else do you key on the fact that your otherwise
portable application requires otherwise nonportable or special
support?  That is, what is the portable mechanism for saying that
you are in need of non-standard support?

Or are you saying that unless it can be handled portably in every
environment then it shouldn't be handled by ANSI C?  Because if
that is the case, we might as well chuck the language now and go
make up something more reflective of the real world.

>If you think that a single UNIVERSAL macro would have made this a whole
>lot easier that it happens to normally be, you are dreaming.  There is
>a lot more than that necessary to configure applications to operate in
>a multiplicity of non-hosted environments.

Who does the language serve?  Why was "#ifdef unix" ever useful?

I'm not saying include every marginally useful feature, but I am
suggesting that there are some "marginal" features that are less
"marginal" than others.
-- 
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