Path: utzoo!utgpu!water!watmath!clyde!rutgers!rochester!cornell!uw-beaver!uw-june!uw-entropy!dataio!pilchuck!ssc!kent From: kent@ssc.UUCP (Kent) Newsgroups: comp.sources.bugs Subject: shar Keywords: printf word size null pointer Message-ID: <965@ssc.UUCP> Date: 14 Jan 88 19:59:27 GMT Organization: SSC, Inc., Seattle, WA Lines: 21 This may have been brought up before... I have found a native int size dependency in Gary Perlman's shar, which was posted a while ago. It prints FSIZE, which is of type off_t, which is usually a long. In the printf()'s, the %d's corresponding to the FSIZEs must be changed to %ld or it won't work on a 16 bit machine. Somebody elsewhere (in comp.lang.c, maybe) was annoyed about types like time_t, which pretend to improve portability via data hiding, but actually make a mess, since we need to know the underlying type anyway. This is an excellent example of the kind of problem these things have in c. The only safe way to handle these things (that I can think of) is to use a flock of conversion macros, in stdjunk.h or whatever. #define off_ttol(x) ((long)x) #define ltooff_t(x) ((off_t)x) etcetera...