• 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: Re: Hiding "cast from pointer to integer of different size" warning
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: Hiding "cast from pointer to integer of different size" warning


  • Subject: Re: Re: Hiding "cast from pointer to integer of different size" warning
  • From: "Mark Wagner" <email@hidden>
  • Date: Tue, 19 Sep 2006 10:03:53 -0700

On 9/18/06, Mailing list subscriptions <email@hidden> wrote:
El 18/09/2006, a las 22:59, Mark Wagner escribió:

> Given the following code
>
>    char keyChar = (char)getWgt()->GetNfyData();
>
> where GetNfyData() returns a void *, how can I hide the resulting
> "cast from pointer to integer of different size" warning?  I'm using
> GCC 3.3.

I don't think you can; the warning is there for a reason: because a
sizeof(char) is one byte, I think, but sizeof(void *) is 4 bytes, at
least on PPC and i386 under the current ABI.

Are you sure it's not returning a pointer to char?, in which case you
could just do:

Absolutely certain. It's a data-passing mechanism that's *supposed* to be used by passing a pointer to the data, but for small data items like char and short, the value is passed directly.

--
Mark Wagner
 _______________________________________________
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: Hiding "cast from pointer to integer of different size" warning
      • From: Ofri Wolfus <email@hidden>
References: 
 >Hiding "cast from pointer to integer of different size" warning (From: "Mark Wagner" <email@hidden>)
 >Re: Hiding "cast from pointer to integer of different size" warning (From: Mailing list subscriptions <email@hidden>)

  • Prev by Date: Re: Dead Code Stripping
  • Next by Date: Re: Attach to Process to debug Framework
  • Previous by thread: Re: Hiding "cast from pointer to integer of different size" warning
  • Next by thread: Re: Hiding "cast from pointer to integer of different size" warning
  • Index(es):
    • Date
    • Thread