• 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: Mysterious warning (comparison between pointer and integer)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mysterious warning (comparison between pointer and integer)


  • Subject: Re: Mysterious warning (comparison between pointer and integer)
  • From: Alastair Houghton <email@hidden>
  • Date: Wed, 11 Jul 2007 11:37:59 +0100

On 11 Jul 2007, at 10:01, Stéphane Sudre wrote:

I have a warning in an Obj-C file that is quite mysterious to me:

warning: comparison between pointer and integer

Here is the source code:

[snip]

if (inet_ntop(AF_INET6,&address_,tBuffer,128)!=NULL) // ******* This is where the warning is reported.

[snip]

I am probably missing something obvious or there's a bug in gcc.

I think, though I'm not certain, that you may be missing a

  #include <arpa/inet.h>

at the top of your file. The line you're getting a warning for expands to

if (inet_ntop(30,&address_,tBuffer,128)!=((void *)0)) // ******* This is where the warning is reported.

so if the compiler thought inet_ntop() returned an int (which is the default assumption thanks to K&R), you'd get the warning you're seeing.

Kind regards,

Alastair.

--
http://alastairs-place.net


_______________________________________________ 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: Mysterious warning (comparison between pointer and integer)
      • From: Stephane Sudre <email@hidden>
References: 
 >Mysterious warning (comparison between pointer and integer) (From: Stéphane Sudre <email@hidden>)

  • Prev by Date: Re: Mysterious warning (comparison between pointer and integer)
  • Next by Date: Re: Mysterious warning (comparison between pointer and integer)
  • Previous by thread: Re: Mysterious warning (comparison between pointer and integer)
  • Next by thread: Re: Mysterious warning (comparison between pointer and integer)
  • Index(es):
    • Date
    • Thread