Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 5/3/83; site ukc.UUCP
Path: utzoo!linus!decvax!harpo!ulysses!burl!clyde!floyd!vax135!ukc!lfm
From: lfm@ukc.UUCP (L.Marshall)
Newsgroups: net.unix-wizards
Subject: Another pointer size problem
Message-ID: <4102@ukc.UUCP>
Date: Wed, 22-Feb-84 03:35:28 EST
Article-I.D.: ukc.4102
Posted: Wed Feb 22 03:35:28 1984
Date-Received: Thu, 23-Feb-84 01:42:46 EST
Organization: Computing Lab. Kent University, England
Lines: 20

Another place where pointer sizes can screw you up is in the parameters
to system calls. How many times have you written :

    struct X y;
    read(fd, &y, sizeof(y));

or something similar? This of course *WRONG* and should be :

    read(fd, (char *) &y, sizeof(y));

but how often do you write the coercion? If you had a PERQ (or a PRIME
or a Honeywell...) you would do it all the time (most of the utilities
do it none of the time). So its not just NULL vs 0, at all - let's hear
it for coercions (or do I mean casts?).

  Lindsay F. Marshall
    uucp : ...!(mcvax,vax135)!ukc!lfm
    ARPA : Lindsay_Marshall%NEWCASTLE@MIT-MULTICS
    post : Computing Laboratory, U of Newcastle upon Tyne, U.K.
           +44 - 632 - 329233 xtn 212