Re: C and only C language has a standard 64 bit integer type ?

From: Ioannis Vranos (ivr_at_guesswh.at.grad.com)
Date: 09/21/04


Date: Tue, 21 Sep 2004 01:58:35 +0300

Victor Bazarov wrote:

> You again are missing the point. 'long long' is not an introduction of
> a new keyword, it's a correction in the grammar.

?It is a new type.

> However, int64 or
> any other name that you can come up with for a fixed-size type would be
> an introduction of a new keyword. Do you propose to have 'long char' or
> 'short char' to designate 32-bit or 8-bit types?

? No. How did you reach such a conclusion. What I propose is:

int16 is introduced and is an exact 16-bit type (of course additional
padding bits are allowed). int and short become equivalent of it.

That is, signed int16, int16, signed, signed int, int, signed short,
short to be all equivalent. The same for the unsigned equivalents. That
is unsigned int16 to be the same as unsigned int and unsigned, etc.

int32 is introduced and holds exactly 32-bit values. long becomes
another name of it, as was the case with the above.

signed int32, int32, signed long, long are all the same.

int64 is introduced and holds 64-bit values. signed int64 is equivalent
and unsigned int64 is the unsigned type.

So we can say:

int64 x;

int32 *p = new int32[10];

long *pp = p;

etc.

-- 
Ioannis Vranos
http://www23.brinkster.com/noicys


Relevant Pages

  • Proposal: New types in C++0x
    ... 32 bits and int16 being exactly 16 bits, ... int and short become equivalent of it. ... int32 is introduced and holds exactly 32-bit values. ... int64 is introduced and holds 64-bit values. ...
    (comp.lang.cpp)
  • Re: function returning __int32 in place of __int64
    ... > number (assigned to a __int64 var). ... function returns an int, which is 32 bits on your platform. ... Then include "my_header.h" in all the source files. ... to be an int value, if it fits in an int, or a long value. ...
    (comp.dsp)
  • Re: Proposal: New types in C++0x
    ... > is unsigned int16 to be the same as unsigned int and unsigned, ... > and unsigned int64 is the unsigned type. ... If, for example, there exists a platform that ... then replacing int's representation with a 16 bit representation would break ...
    (comp.lang.cpp)
  • Re: Moving from C++ to VC++
    ... >>> At least your code would then capture your requirement for the type. ... Using __int64 just means that int and long wasn't enough, ... We just get yet another long type problem! ...
    (microsoft.public.vc.language)
  • uint8_t / uint16_t / uint32_t / uint64_t in streams
    ... typedef unsigned __int8 uint8_t; ... typedef unsigned __int16 uint16_t; ... typedef unsigned __int32 uint32_t; ... typedef unsigned __int64 uint64_t; ...
    (microsoft.public.vc.language)

Loading