Can Novices Jump Directly in C? (Books)

Karl Heuer karl at ima.isc.com
Wed Feb 13 14:17:02 AEST 1991


In article <KERS.91Feb11094224 at cdollin.hpl.hp.com> kers at hplb.hpl.hp.com (Chris Dollin) writes:
>mike at bria writes:
>>To write portable code, the use of values.h and sys/types.h is essential,
>
>Use "values.h" or "sys/types.h" on *my* machine [*1], and your code won't
>compile at all; I have a plain ANSI C compiler, and neither of those names
>appear to be in the standard.
>
>Is their general agreement on the contents of these headers...?

<sys/types.h> is defined by the POSIX standard.  Types that are useful to a
pure ANSI C program are already defined in ANSI headers (e.g. time_t in
<time.h>), so there's no need for <sys/types.h> here.  And you should use
<limits.h> rather than <values.h> if you want portability.%

Karl W. Z. Heuer (karl at ima.isc.com or uunet!ima!karl), The Walking Lint
________
% Even on a pre-ANSI system.  There are PD configuration tools that will
  build <limits.h> for you.



More information about the Comp.lang.c mailing list