FROM : Ken Tozier
DATE : Sat Apr 02 17:20:27 2005
On Apr 2, 2005, at 4:42 AM, Ondra Cada wrote:
> Ken,
>
> On 2.4.2005, at 11:00, Ken Tozier wrote:
>
>> In lieu of using "long long" and "unsigned long long" in my code, I'm
>> trying to use the more compact "SInt64" and "UInt64" both of which
>> the compiler seems to be aware of , but when I try to give UInt64 a
>> large constant hex value such as 0xFFFFFFFFFFFFFFFF, the complier
>> complains that "integer constant is too large for "long" type." I
>> searched for the definition of UInt64 and found it in MacTypes.h
>> where it is defined as "typedef unsigned long long UInt64" so why
>> does the compiler not allow the maximum hex value? Is there some
>> undocumented upper limit to long long values?
>
> Check the compiler support for big constants. By default, these
> constants are integers (the compiler, at the time the constant is
> interepreted, does not and cannot know you will store it into a long
> or even long long), and thus self-evidently too big.
>
> You'll have to use some suffix, like 0xFF...FFull (or something), to
> let the compiler know the constant is long long AND unsigned, too. At
> the moment, I don't recall the proper suffix though, sorry.
Adding "ull" suffix did the trick. Thanks
Ken
> ---
> Ondra Čada
> OCSoftware: <email_removed> http://www.ocs.cz
> private <email_removed> http://www.ocs.cz/oc
>
DATE : Sat Apr 02 17:20:27 2005
On Apr 2, 2005, at 4:42 AM, Ondra Cada wrote:
> Ken,
>
> On 2.4.2005, at 11:00, Ken Tozier wrote:
>
>> In lieu of using "long long" and "unsigned long long" in my code, I'm
>> trying to use the more compact "SInt64" and "UInt64" both of which
>> the compiler seems to be aware of , but when I try to give UInt64 a
>> large constant hex value such as 0xFFFFFFFFFFFFFFFF, the complier
>> complains that "integer constant is too large for "long" type." I
>> searched for the definition of UInt64 and found it in MacTypes.h
>> where it is defined as "typedef unsigned long long UInt64" so why
>> does the compiler not allow the maximum hex value? Is there some
>> undocumented upper limit to long long values?
>
> Check the compiler support for big constants. By default, these
> constants are integers (the compiler, at the time the constant is
> interepreted, does not and cannot know you will store it into a long
> or even long long), and thus self-evidently too big.
>
> You'll have to use some suffix, like 0xFF...FFull (or something), to
> let the compiler know the constant is long long AND unsigned, too. At
> the moment, I don't recall the proper suffix though, sorry.
Adding "ull" suffix did the trick. Thanks
Ken
> ---
> Ondra Čada
> OCSoftware: <email_removed> http://www.ocs.cz
> private <email_removed> http://www.ocs.cz/oc
>
| Related mails | Author | Date |
|---|---|---|
| Ken Tozier | Apr 2, 11:00 | |
| Dave Rehring | Apr 2, 11:40 | |
| Ondra Cada | Apr 2, 11:42 | |
| Ken Tozier | Apr 2, 17:20 | |
| Scott Ribe | Apr 3, 08:18 | |
| Segher Boessenkool | Apr 4, 10:45 |






Cocoa mail archive

