• 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: gcc-4.2 -pedantic is too pedantic
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gcc-4.2 -pedantic is too pedantic


  • Subject: Re: gcc-4.2 -pedantic is too pedantic
  • From: Clark Cox <email@hidden>
  • Date: Thu, 17 Sep 2009 23:03:04 +0200

On Wed, Sep 16, 2009 at 4:41 PM, John Reppy <email@hidden> wrote:
> When compiling some existing code on Snow Leopard, I'm getting warnings
> about the use the use of the "%p" format specifier that seem excessive.
> For example
>
>        <jhr@woton> cat p.c
>        #include <stdio.h>
>        void foo (int *x) { printf("%p\n", x); }
>        <jhr@woton> gcc -c -pedantic -m64 p.c
>        p.c: In function ‘foo’:
>        p.c:2: warning: format ‘%p’ expects type ‘void *’, but argument 2 has
> type ‘int *’
>
> Since pointer types silently convert to void * in other cases, this warning
> seems wrong to me.

They do not automatically convert when passed to functions such as
printf, and the C standard allows different pointer types to have
different representations. GCC is technically correct in offering this
warning (you *did* ask it to be pedantic :) )

--
Clark S. Cox III
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: 
 >gcc-4.2 -pedantic is too pedantic (From: John Reppy <email@hidden>)

  • Prev by Date: Re: where is the "Xcode Project Management Guide"?
  • Next by Date: Xcode is unable to copy file
  • Previous by thread: Re: gcc-4.2 -pedantic is too pedantic
  • Next by thread: NSToolTipOwner Protocol and Xcode 3.2 build failure in Debug Build Configuration
  • Index(es):
    • Date
    • Thread