• 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: CGFloat and 64 Bit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CGFloat and 64 Bit


  • Subject: Re: CGFloat and 64 Bit
  • From: "Sean McBride" <email@hidden>
  • Date: Mon, 9 Feb 2009 13:04:50 -0500
  • Organization: Rogue Research Inc.

On 2/9/09 11:59 AM, Jean-Daniel Dupas said:

>> Hmm, I think it might be "Implicit Conversion to 32 bit
>> type" (GCC_WARN_64_TO_32_BIT_CONVERSION).
>
>IMHO, this flag is recommended only to compile 64 bits code. On 32
>bits arch, as you saw, most of the warnings are irrelevant.

I disagree.  It can help catch things like converting off_t and fpos_t to int.

I agree with the OP that CGFloat is very annoying in this respect.  My
solution has been to use the 'f' suffix for constants. Similarly, there
is no CGFloat version of sin() and other math functions.



On 2/9/09 9:26 AM, Nick Zitzmann said:

>As I said earlier in this thread, the compiler flag -fsingle-precision-
>constant tells GCC to treat double constants as if they were float
>constants. Use it when building your 32-bit executables and you won't
>lose any precision when doing math in your 64-bit executables.

This could be dangerous if you have some code that really expects double
constans to be doubles.



On 2/8/09 11:14 PM, Clark Cox said:

>> A somehow related question:
>> How does one find out, in which mode (32 vs. 64 bit) an app is running?
>
>#ifdef __LP64__

Apple's headers inconsistently use #if and #ifdef.  I recommend:

#if defined (__LP64__) && __LP64__

which will also not warn with -Wundef.

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: CGFloat and 64 Bit
      • From: Clark Cox <email@hidden>
    • Re: CGFloat and 64 Bit
      • From: Nick Zitzmann <email@hidden>
    • Re: CGFloat and 64 Bit
      • From: Jean-Daniel Dupas <email@hidden>
References: 
 >CGFloat and 64 Bit (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: CGFloat and 64 Bit (From: Rob Keniger <email@hidden>)
 >Re: CGFloat and 64 Bit (From: Jean-Daniel Dupas <email@hidden>)
 >Re: CGFloat and 64 Bit (From: Rob Keniger <email@hidden>)
 >Re: CGFloat and 64 Bit (From: Jean-Daniel Dupas <email@hidden>)
 >Re: CGFloat and 64 Bit (From: Rob Keniger <email@hidden>)
 >Re: CGFloat and 64 Bit (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: Re: Reading MP3 data into a NSDocument using QTKit, -readFromData:, and QTDataReference
  • Next by Date: Scroll bars in NSTokenField?
  • Previous by thread: Re: CGFloat and 64 Bit
  • Next by thread: Re: CGFloat and 64 Bit
  • Index(es):
    • Date
    • Thread