(int << ulong) == int ?

Brad Roberts braddr at puremagic.com
Sun Aug 7 15:45:25 PDT 2011


Which has nothing to do with the question about integral promotion.  

On Aug 7, 2011, at 3:07 PM, bearophile <bearophileHUGS at lycos.com> wrote:

> Dmitry Olshansky:
> 
>> Sorry for the noise.
> 
> It's not noise, and you don't need to be sorry, in my opinion it's a D/DMD design fault. Clang gives an error on code like that:
> http://blog.llvm.org/2011/05/c-at-google-here-be-dragons.html
> 
> See the error:
> example2.cc:12:25: error: shift result (10737418240) requires 35 bits to represent, but 'int' only has 32 bits [-Werror,-Wshift-overflow]
> long kMaxDiskSpace = 10 << 30;
> 
> In my opinion D has to give a similar error.
> 
> Bye,
> bearophile


More information about the Digitalmars-d-learn mailing list