Re: size of integer



junky_fellow@xxxxxxxxxxx wrote on 02/08/05 :
How do we decide the value of INT_MIN and INT_MAX ? Does the
compiler refers to this value to determine the size of int ?

Are these values always fixed for a specific platform and who
decides these values ?

They are platform-dependent. The implementer decides in accordance with the features of the achitecture.


x86 real mode is 16-bit oriented
x86 protected mode is 32-bit oriented
68000 is 32-bit oriented
etc.

8051 is 8-bit oriented, that makes it a bad candidate for a C-implementation, but with the help of external libraries (and poor performances), implementations of C for 8051 exists (Keil etc.)


-- Emmanuel The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html The C-library: http://www.dinkumware.com/refxc.html

"It's specified. But anyone who writes code like that should be
transmogrified into earthworms and fed to ducks." -- Chris Dollin CLC


.



Relevant Pages

  • Re: Moving from C++ to VC++
    ... If it is the longest integer. ... platform, I want the longest integer type ... Now /I/ would like to have 'int' being the ... Adhering to what computing standards' intention ...
    (microsoft.public.vc.language)
  • Re: I2C bus implementation (for MPC82xx)
    ... > PowerMac (see the patches that just went in rewriting the PowerMac i2c ... > smbus API, but then, do you really want to use an existing i2c driver? ... For the resources I have used platform definition. ... +static int ...
    (Linux-Kernel)
  • Re: Using OleDBParameter in a simple UPDATE statement
    ... apparently the SQL commands via the .NET OleDb objects w/MySQL are required ... Actually that is specific to the underlying database you are ... Also you might already know this, but an int to one ... > platform might be not an int some other platform. ...
    (microsoft.public.dotnet.framework.adonet)
  • [PATCH v2 9/10] x86/apic: RFC decouple legacy irq handling in ioapic
    ... This patch uses platform feature flags to separate i8259/PIC from ioapic. ... unsigned int num_processors; ...
    (Linux-Kernel)
  • Re: Type of argc
    ... So did removing implicit int, but it improved the language nevertheless. ... Clever programmer #2 has to port the program to platform #2 which has a compiler not up to date. ... And that this C implementation could provide a non-standard way to access all the parameters, such as making argv a NULL-terminated string of pointers to char. ...
    (comp.std.c)