From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,df854b5838c3e14 X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,df854b5838c3e14 X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,df854b5838c3e14 X-Google-Attributes: gid1014db,public X-Google-Thread: 10db24,fec75f150a0d78f5 X-Google-Attributes: gid10db24,public From: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: ANSI C and POSIX (was Re: C/C++ knocks the crap out of Ada) Date: 1996/04/09 Message-ID: #1/1 X-Deja-AN: 146540106 references: <4kb2j8$an0@solutions.solon.com> <4kbrt5$k3h@mulga.cs.mu.OZ.AU> <4kcpgkINNcku@keats.ugrad.cs.ubc.ca> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.edu Date: 1996-04-09T00:00:00+00:00 List-Id: Kazimir quoted "Peter's FAQ" as saying: 1.3: If I write the code int i, j; can I assume that (&i + 1) == &j? A: Only sometimes. It's not portable, because in EBCDIC, i and j are not adjacent. I think a smiley is missing here. This is a nice joke, but one can only hope that no one thinks that the EBCDIC comment is technically relevant. Incidentally, the answer that int should always be 64 bits on a 64-bit machine is far too facile. This is a very tricky question, which has been debated endlessly and no satisfactory solution found. There are very delicate tradeoffs to be made between efficiency, functionality, and portability here, and the final outcome is far from clear. Lots of C programs assume that long is 32 bits. Yes of course they are broken, yes of course this was a naughty assumption (of course ther is no way in C to get a guaranteed 32-bit integer type, so it is not surprising that C code is often broken in this manner). This means that making int (and hence long?) 64 bits caues serious porability problems. Yes, of course I talk about portability problems in a pragmatic sense, it is the only useful sense in whch to discuss them, since the discussion in purely language terms is vacuuous.