Path: utzoo!attcan!uunet!oddjob!ncar!ames!oliveb!sun!smile!alanf From: alanf%smile@Sun.COM (Alan Fargusson) Newsgroups: comp.sources.d Subject: Re: Something's Broken: was ... Re: tgetent Summary: The real point Keywords: tgetent,core dump,sco,xenix,large model Message-ID: <59957@sun.uucp> Date: 14 Jul 88 21:06:37 GMT References: <54@libove.UUCP> <701@nod2sco> <3222@bigtex.uucp> <1033@ficc.UUCP> <19829@watmath.waterloo.edu> Sender: news@sun.uucp Distribution: comp Lines: 22 The original problem was a program that did not declare the return value of a function. In C it is assumed that the return value is int, but this is beside the point. The bug was that the return value was not declared, and declaring it fixes the bug. As for pointer and int problems, the size of a pointer relative to an int is a problem with some compilers. But this is not the only problem of this type. On any machine calling lseek( fd, 0, 0 ) is wrong because the second argument is a long. This works on 32 bit machines, but not 16 bit machines. In defense of Intel (how did I end up defending Intel) this is more of a problem on the 68K if the compiler uses 16 bit integers. On the 68K it is possible to have a structure that is larger than 64Kb, so the address will not fit in a 16 bit integer. On the 80[12]86 it is not possible to have a structure that is larger than 64K, and each structure will be contained in one segment, so the difference between two address will fit in a 16 bit int. I am assuming that you are not using huge model. If you are then 32 bit integers are used for pointer arithmetic. - - - - - - - - - - - - - - - - - - - - - Alan Fargusson Sun Microsystems alanf@sun.com ..!sun!alanf