• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: uint64_t error and architecture targets
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: uint64_t error and architecture targets


  • Subject: RE: uint64_t error and architecture targets
  • From: Jeff Laing <email@hidden>
  • Date: Fri, 11 Feb 2011 03:52:46 +0000
  • Acceptlanguage: en-US
  • Thread-topic: uint64_t error and architecture targets

> The "UL" at the end of your literal indicates that you want it to be (unsigned
> long). On 32-bit, that isn't possible, and that is what the compiler is
> telling you. Use "ULL".
>
> On the other hand, a convenient way to get the maximum value into an unsigned
> variable, regardless of its size is to use -1"
>
> uint64_t y = -1;

Hmmm, I'd have thought proper compilers would have complained about that being a signed value in an unsigned variable.  Are you sure you don't have a warning turned down somewhere?

I've always used ~0 to achieve this result.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: uint64_t error and architecture targets
      • From: "Clark S. Cox III" <email@hidden>
References: 
 >uint64_t error and architecture targets (From: Todd Heberlein <email@hidden>)
 >Re: uint64_t error and architecture targets (From: "Clark S. Cox III" <email@hidden>)

  • Prev by Date: Re: uint64_t error and architecture targets
  • Next by Date: Re: uint64_t error and architecture targets
  • Previous by thread: Re: uint64_t error and architecture targets
  • Next by thread: Re: uint64_t error and architecture targets
  • Index(es):
    • Date
    • Thread