stdlib.h

Alan J Rosenthal flaps at dgp.toronto.edu
Sat Aug 11 04:54:45 AEST 1990


cazier at mbunix.mitre.org (Cazier) writes:
>... [developed] using ANSI restrictions under a turbo C environment.
>... UNIX-PC complained of not finding "stdlib.h" ...
>... so is it the UNIX-PC compiler that's at fault or am I playing with a toy
>compiler on the DOS side of the house to fit BIOS requirements?

The ansi C committee invented enough things that it's unlikely that a program
written with only ansi-c portability in mind will work on a non-ansi-c
compiler.  The unix-pc compiler is probably at fault only in that it is not
ansi-compliant.  Of course, your turbo C compiler is probably not entirely
ansi-compliant unless it's a very recent version which came out after the
standard was published in its final form.

Very wide portability these days can probably be achieved only by referring to
BOTH editions of Kernighan and Ritchie, and mostly the first.  void, enum, and
structure assignment are probably ok, but otherwise you should probably stick
to the first edition, except where the second edition contradicts it (e.g.
don't write into string constants).

ajr



More information about the Comp.std.c mailing list