Xref: utzoo comp.unix.xenix:2605 comp.sources.d:2399 Path: utzoo!attcan!uunet!pilchuck!ssc!markz From: markz@ssc.UUCP (Mark Zenier) Newsgroups: comp.unix.xenix,comp.sources.d Subject: Re: tgetent core dump on sco xenix Summary: Function Arguements Keywords: tgetent,core dump,sco,xenix,large model Message-ID: <1319@ssc.UUCP> Date: 4 Jul 88 19:36:11 GMT References: <54@libove.UUCP> <701@nod2sco> <3222@bigtex.uucp> Distribution: comp Organization: SSC, Inc., Seattle, WA Lines: 24 In article <3222@bigtex.uucp>, james@bigtex.uucp (James Van Artsdalen) writes: : IN article <701@nod2sco>, rosso@sco.COM (Ross Oliver) wrote: : > Here are a few tips to avoid problems like this in large-model : > 286 programs: : : > - Declare your functions' return values. : > - Don't use "0" to mean NULL ( i.e. (char *)0 ). : : This last statement is incorrect, or rather, evidence of a broken : compiler. > : C requires that the integer constant 0 be assignable to *any* pointer : type. C also requires that any pointer type may be compared with the : integer constant 0. If the Xenix compiler requires that the integer : constant 0 be cast to a pointer type first, it is broken. Until ANSI C exists, there is no way the compiler can tell type of the expression for a function arguement that is pushed on the stack. It would have been safer but much slower if Microsoft has chosen the default integer size at 32 bits for large model compiles. Mark Zenier uunet!pilchuck!ssc!markz "Kinda scary. One guy said he had heard they were a bunch of wierdo gourmets from somewhere in Orange County, looking for new taste thrills."