Re: Mysterious warning (comparison between pointer and integer)
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