• 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: XCode 2.0: what happened to long long?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XCode 2.0: what happened to long long?


  • Subject: Re: XCode 2.0: what happened to long long?
  • From: David Leimbach <email@hidden>
  • Date: Mon, 27 Jun 2005 09:04:21 -0700

On 6/27/05, Glen Low <email@hidden> wrote:
>
> On 27/06/2005, at 8:51 AM, Ken Brooks wrote:
>
> On 25 Jun 2005, at 14:25, Ken Brooks wrote:
>
>
>
> This code quit compiling when I went to XCode 2.0.  What's up with long
> long?
>
>   typedef unsigned long long PathTrace;
>
>    const PathTrace trace0 = 0;
>    const PathTrace trace1 = 0x8000000000000000;
>
>    long long myvar = 0x8000000000000000;
>
> The errors:
>
> /Users/ken/Programs/Cat & Mouse 2view + AI/TestFile.cpp:4: error: integer
> constant is too large for 'long' type
> /Users/ken/Programs/Cat & Mouse 2view + AI/TestFile.cpp:6: error: integer
> constant is too large for 'long' type
>
> At 2:30 PM +0100 6/25/05, Frederick Cheung wrote:
> You need to append LL or ULL to the constant (eg 0x8000000000000000ULL)
>
> Fred
>
> Thanks, Fred.  That fixed it right up.
>
> Now, where was this NEW REQUIREMENT documented?  I read the 2.0 release
> notes carefully, and found nothing of the sort.
> gcc 4.0 is trying to be more conformant to the C/C++ spec, which IIRC says
> that constants fit into the smallest of s/u char, short or int that will fit
> by default. long long is not in the standard.
>

It's in the C99 standard.  [long long]

But it's always better to specify what you mean with literals.

1.0 is a double
1.0f is a float
"Hello" is a  char const []
L"Hello" is a  wchar_t const []

etc etc.

Dave
>
>
> Cheers, Glen Low
>
>
>
>
>
>
>
> ---
>
> pixelglow software | simply brilliant stuff
>
> www.pixelglow.com
>
> aim: pixglen
>
>  _______________________________________________
> 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
>
>
 _______________________________________________
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

References: 
 >Re: XCode 2.0: what happened to long long? (From: Frederick Cheung <email@hidden>)
 >Re: XCode 2.0: what happened to long long? (From: Glen Low <email@hidden>)

  • Prev by Date: Re: What ends up in the "Bundle Resources" group
  • Next by Date: -weak_framework entry point testing?
  • Previous by thread: Re: XCode 2.0: what happened to long long?
  • Next by thread: How to make XCode use a shared build location inside an application package?
  • Index(es):
    • Date
    • Thread