Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!nsc!pyramid!infmx!mdelaney From: mdelaney@infmx.UUCP (Mark Delaney) Newsgroups: comp.unix.wizards Subject: Re: unsigned sizeof() Message-ID: <3417@infmx.UUCP> Date: 17 Feb 90 02:59:25 GMT References: <6042@arctic.nprdc.arpa> <12141@smoke.BRL.MIL> Reply-To: mdelaney@infmx.UUCP (Mark Delaney) Organization: Informix, Menlo Park, Ca. U.S.A. Lines: 23 In article <12141@smoke.BRL.MIL> gwyn@smoke.BRL.MIL (Doug Gwyn) writes: >In article <6042@arctic.nprdc.arpa> stanonik@nprdc.navy.mil (Ron Stanonik) writes: >>Sorry if this is old news. It was a surprise to us; ie, sizeof >>on our suns and vax (4bsd) returns signed. > >Well, their C compilers were based on old, decrepit versions of PCC. >And non-portable programs abound, so you really shouldn't be surprised >that you encountered one. We too were surprised when this sizeof() caused problems while porting. Does anyone know of a product (free or purchased) that runs on SunOS that could help in finding these little unportable problems? I checked in the fall 1989 edition of Catalyst (catalog of third-party products for Suns), but didn't find anything helpful. I use lint, but it doesn't catch the sizeof() problem. I would upgrade to ANSI C but we don't have ANSI C compilers on all of the machines we port to. I heard gcc has some good warnings build in; has anyone with gcc found that it catches this problem when the warning flag is on. Oh yea, please don't flame me about good programming practices would solve this problem. I try to write portable code, but still some bugs get through. - Mark Delaney