delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/10/06/02:07:38

Subject: Re: djgpp and the 386SX
To: eliz AT is DOT elta DOT co DOT il
Date: Wed, 5 Oct 1994 23:42:45 -0600 (CDT)
Cc: lopez AT vsl DOT ist DOT ucf DOT edu, brian_acton AT powertalk DOT apple DOT com,
djgpp AT sun DOT soe DOT clarkson DOT edu
From: mcastle AT umr DOT edu (Mike Castle)

Amazingly enough eliz AT is DOT elta DOT co DOT il said:
> 
> > Off hand I don't know what the "-mno-486" flag does but by ANSI C 
> > definitions, an signed integer as you have declared "i" to be; has the 
> > maximum and minimum values of -32,767 to 32,767. You want to declare "i" 
> 
> Wrong!  GCC produces 32-bit code, which means int is 32 bit, not 16.  So
> it can hold values upto 2 million.

Ansi requires that "int" be AT LEAST -32,767 to 32,767.  A
specific implementation may make that larger, but it's not a
necessity (in short, gcc could use 16-bit ints, and be perfectly
ansi conforming).  

In standard C, sizeof(short)<=sizeof(int)<=sizeof(long)
In ANSI C, short>=16bits, int>=16bits, long>=32bits.

Conceivably all three can be 64bits if the implementation so
desires.

mrc
-- 
Mike Castle .-=NEXUS=-.  Life is like a clock:  You can work constantly
  mcastle AT cs DOT umr DOT edu     and be right all the time, or not work at all
   mcastle AT umr DOT edu       and be right at least twice a day.  -- mrc
    We are all of us living in the shadow of Manhattan.  -- Watchmen

- Raw text -


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