help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: const uint64_t initialization problem


From: Mike - EMAIL IGNORED
Subject: Re: const uint64_t initialization problem
Date: Thu, 07 Dec 2006 13:01:19 -0500
User-agent: Pan/0.14.2.91 (As She Crawled Across the Table)

On Thu, 07 Dec 2006 12:26:17 -0500, Mike - EMAIL IGNORED wrote:

> On FC4 with g++ (GCC) 4.0.2 20051125 (Red Hat 4.0.2-8):
> 
>    unsigned long long int  mask = 0x003fffffffffffff;
>    const uint64_t          mask = 0x003fffffffffffff;
>    const uint64_t          mask = static_cast<uint64_t>(0x003fffffffffffff);
> 
> all result in:
> 
>    error: integer constant is too large for 'long' type
> 
> I workaround with:
> 
>    const uint64_t    mask = (0x003fffff << 32) | 0xffffffff;
> 
> Is this as expected?  Is it fixed in a later version?
> 
> Thanks,
> Mike.

Correction.  I need:

   const uint64_t    mask = 
       ((static_cast<uint64_t>(0x003fffff) << 32) | 0xffffffff;

Mike.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]