Re: Moving from C++ to VC++
- From: "Doug Harrison [MVP]" <dsh@xxxxxxxx>
- Date: Mon, 13 Jun 2005 10:27:27 -0500
On Mon, 13 Jun 2005 12:51:23 +0200, Hendrik Schober wrote:
> 'long' being 32bits wasn't guaranteed earlier,
> so it isn't needed for backwards compatibility.
It's needed to the extent people assumed 32 bit longs. As Carl told you
earlier, it was determined "a great deal more code would be broken by
chanigng long to 64 bits than would benefit from the change", so why are
you still trying to argue like that?
> > There's no guarantee short is smaller than int, [...]
>
> No, there isnt'. If I need "rather small
> integers" only, I'll still use it for
> certain definitions of "rather small".
> (Like in the range -100 < x < 100.) If I
> need 32bits, I can use 'int32_t'.
Having used a CPU that didn't implement 16 bit shorts natively and a
compiler that simulated them for compatibility purposes, I would never use
short when I could use int. The only reason I would ever use short is to
save space, but to use it to save space is to use it non-portably, possibly
to the great detriment of efficiency, particularly if you use it in
calculations and not just as a storage type.
> > [...] Not to mention, your "no
> > excuse" comment about 64 bit longs suggests you might use it non-portably
> > if it were available to you. I mean, if you're such a portable guy, why
> > would you even care about this?
>
> Because now I have to use '__int64'?
At least your code would then capture your requirement for the type.
--
Doug Harrison
Microsoft MVP - Visual C++
.
- Follow-Ups:
- Re: Moving from C++ to VC++
- From: Hendrik Schober
- Re: Moving from C++ to VC++
- From: Bo Persson
- Re: Moving from C++ to VC++
- References:
- Moving from C++ to VC++
- From: NoName
- Re: Moving from C++ to VC++
- From: Severian [MVP]
- Re: Moving from C++ to VC++
- From: Victor Bazarov
- Re: Moving from C++ to VC++
- From: Carl Daniel [VC++ MVP]
- Re: Moving from C++ to VC++
- From: Hendrik Schober
- Re: Moving from C++ to VC++
- From: Carl Daniel [VC++ MVP]
- Re: Moving from C++ to VC++
- From: Hendrik Schober
- Re: Moving from C++ to VC++
- From: Doug Harrison [MVP]
- Re: Moving from C++ to VC++
- From: Hendrik Schober
- Re: Moving from C++ to VC++
- From: Doug Harrison [MVP]
- Re: Moving from C++ to VC++
- From: Hendrik Schober
- Moving from C++ to VC++
- Prev by Date: Re: Sleep
- Next by Date: Re: Moving from C++ to VC++
- Previous by thread: Re: Moving from C++ to VC++
- Next by thread: Re: Moving from C++ to VC++
- Index(es):
Loading