Re: Moving from C++ to VC++



Hendrik Schober wrote:
> Carl Daniel [VC++ MVP]
> <cpdaniel_remove_this_and_nospam@xxxxxxxxxxxxxxx> wrote:
>> Victor Bazarov wrote:
>> [...]
>>> 'long' is 32 bits on a 64-bit platform? Wow... No, really? I am
>>> blown away, honestly.
>>
>> On 64 bit Windows, yes. Many 64-bit *nix's chose to make long be 64
>> bits.
>>
>> This decision was based on a survey of several million lines of code
>> that revealed that a great deal more code would be broken by
>> chanigng long to 64 bits than would benefit from the change.
>
> Good approach, really. Everybody played it
> stupid, so we just adapt to stupidity.
> Honestly, what will do we do when 128bit
> processors come? Keep 'long' at 32bit, just
> because it's been this way for decades???
>
> (Can you tell that this attitude to value
> the past over the future is really getting
> on my nerves?)

The fact is, very few applications will ever need to use a 64-bit integer
type, even fewer will need a 128-bit integer. Breaking compatibility with
untold scores of current programs to favor those very few future programs
that need the larger type just doesn't make sense. Those few programs that
do need that large integer size can simply use __int64 (or int_t<64>, or
whatever other new integer types we may see in C++ in the future).

The legitimate, common uses I can see for a 64 bit integer type involve
representation of values of or differences between 64 bit pointers, and we
have size_t and prtdiff_t for that (and yes, they're both 64 bits on 64 bit
Windows).

-cd


.



Relevant Pages

  • Re: Moving from C++ to VC++
    ... >> Victor Bazarov wrote: ... >>> blown away, honestly. ... >> This decision was based on a survey of several million lines of code ... > stupid, so we just adapt to stupidity. ...
    (microsoft.public.vc.language)
  • Re: Moving from C++ to VC++
    ... >> blown away, honestly. ... > This decision was based on a survey of several million lines of code that ... stupid, so we just adapt to stupidity. ... I'm Schobi at suespammers dot org ...
    (microsoft.public.vc.language)