Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!zaphod.mps.ohio-state.edu!think.com!mintaka!spdcc!ima!dirtydog!karl From: karl@ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: int32 et al. Message-ID: <1991Jan22.023844.29849@dirtydog.ima.isc.com> Date: 22 Jan 91 02:38:44 GMT References: <26@christmas.UUCP> <867@TALOS.UUCP> <1991Jan19.185101.27554@odi.com> <14905@smoke.brl.mil> <1991Jan21.135216.23447@odi.com> Sender: news@dirtydog.ima.isc.com (NEWS ADMIN) Organization: Interactive Systems Lines: 27 In article <1991Jan21.135216.23447@odi.com> benson@odi.com (Benson I. Margulies) writes: >>>If we used int for a 32 byte int, we are nailed on the PCs. If we use >>>long, C++ compilers tend to moan piteously about [type clash] > >The system include files contain > extern int blahblah (int, char *); >I don't control that declaration. If I call blahblah with a long, >the compiler bleats a warning. How does int32 help, then? You said you define int32 as long on some machines (PCs), so passing an int32 to this function is just wrong. Looks to me as though you need to cast% it to int, regardless of whether you're using int32 or long. >for > extern int quux (int *); >if I pass a long * I get an error, not just a warning. >So I can't just use long all the time unless I type in all my >own system function prototypes. And here, it's worse. If you fake it with a cast or by writing a fake prototype, you're likely to get the wrong answer, on machines where int and long have different sizes. Again, I see no advantage of int32 over long. Karl W. Z. Heuer (karl@ima.isc.com or uunet!ima!karl), The Walking Lint ________ % Assuming you already know it fits in an int.