Something's Broken: was ... Re: tgetent

Ross Wetmore rwwetmore at grand.waterloo.edu
Sat Jul 9 00:23:20 AEST 1988


In article <1033 at ficc.UUCP> peter at ficc.UUCP (Peter da Silva) writes:
>In article <3222 at bigtex.uucp>, james at bigtex.uucp (James Van Artsdalen) writes:
>> IN article <701 at nod2sco>, rosso at sco.COM (Ross Oliver) wrote:
>>>     - Don't use "0" to mean NULL ( i.e. (char *)0 ).
>> This last statement is incorrect, or rather, evidence of a broken
>> compiler.

>He's speaking in the context of a function call. Large model 286
>programs have 32 bit pointers but 16 bit integers, so if you pass
>0 to a function expecting a pointer the stack will be off by two
>bytes.

And large model '386 programs have 48 bit pointers and 32 bit ints ...

>So, the problem isn't a broken compiler, it's a broken CPU architecture.

>-- `-_-' Peter (have you hugged your wolf today) da Silva.
>--   U   Ferranti International Controls Corporation.

  The assumption that pointers and ints are of equal length is the 
problem, no? This is a fundamental assumption of the 'C' language, 
if not an explicit requirement.

  It would be unfair to fault either the architecture, or compiler in
this case. It just means the 'C' language was designed for a certain
class of hardware and thus has limited use in its pristine (unkludged) 
form.

Ross W. Wetmore                 | rwwetmore at water.NetNorth
University of Waterloo          | rwwetmore at math.Uwaterloo.ca
Waterloo, Ontario N2L 3G1       | {uunet, ubc-vision, utcsri}
(519) 885-1211 ext 3491         |   !watmath!rwwetmore



More information about the Comp.unix.xenix mailing list