delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/10/08/03:14:15

Date: Sat, 8 Oct 94 15:30:06 JST
From: Stephen Turnbull <turnbull AT shako DOT sk DOT tsukuba DOT ac DOT jp>
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: djgpp and the 386SX

   On Thu, 6 Oct 1994, Don L. wrote:
   > > Wrong!  GCC produces 32-bit code, which means int is 32 bit, not 16.  So
   > > it can hold values upto 2 million.
   > > 
   > > 	Eli Zaretskii

   > No this is not wrong, it is completly dependent on the platform
   > and compiler you are working with, for portablity reasons you
   > should assume a 16-bit int.
   > Don ;)

   Yes, I think it is wrong, What Eli is talking about is DJgpp (that is 
   what this list server is about!).  If you want to talk about some other 
   implementation of C, there are other mail groups available.  BUT, for the 
   purposes of DJGPP, THIS compler DOES use 32-bit int's.  SO, the answer is 
   definately -- WRONG!

   Fred Reimer

Not only is it definitely wrong, but it's wrong-headed, too.  "For
portability reasons" one makes *no* assumptions that one can avoid.
Even assuming ANSI minimum sizes can bite you.  (Eg, in packed
structures with DJGPP you can't use unsigned, you must use unsigned
short if you want to map to a 16-bit field.  And of course in X
Consortium code, not even shorts are used---eg for wide characters
they use two-byte arrays.)  On an ANSI compiler you don't need to make
assumptions, you can use the values that are required to be defined in
limits.h (I think that's the right file).  
-- 
Steve "My 2 yen is worth 2.8% more than your 2 cents" Turnbull

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019