• 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: long Tigers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: long Tigers


  • Subject: Re: long Tigers
  • From: Clark Cox <email@hidden>
  • Date: Fri, 13 May 2005 07:27:43 -0400

On 5/13/05, Gerriet M. Denkmann <email@hidden> wrote:
> Tiger has cleaned up some definitions. This is a good thing. But it
> confuses my compilers.
>
> E.g. in /usr/include/mach-o/loader.h
> Panther:
> struct mach_header {
>         unsigned long   magic;
> ... }
>
> Tiger:
> struct mach_header {
>         uint32_t        magic;
> ... }
>
> When I have:
> fprintf( stderr, "magic %#x\n", __FUNCTION__, head1->magic);
> the Panther compiler rightly complains: "unsigned int format, long
> unsinged int arg".
>
> And when I switch to "%#lx" the Tiger compiler says: "format "%#lx
> expects 'long unsigned int' but argument has type 'uint32_t'"
>
> What is the clever way to make it compile both on Panther and Tiger
> without switching the warning off? And preferably without hundreds of
> #ifdefs.

This should be correct on both platforms (make sure to #include <inttypes.h>):

fprintf( stderr, "magic %#"PRIx32"\n", (uint32_t)head1->magic);


--
Clark S. Cox III
email@hidden
http://www.livejournal.com/users/clarkcox3/
http://homepage.mac.com/clarkcox3/
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: long Tigers
      • From: "Gerriet M. Denkmann" <email@hidden>
References: 
 >long Tigers (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Getting keydown events during a drag
  • Next by Date: Re: Display Keys-Values in Spotlight
  • Previous by thread: Re: long Tigers
  • Next by thread: Re: long Tigers
  • Index(es):
    • Date
    • Thread