Mysterious warning (comparison between pointer and integer)
Mysterious warning (comparison between pointer and integer)
- Subject: Mysterious warning (comparison between pointer and integer)
- From: Stéphane Sudre <email@hidden>
- Date: Wed, 11 Jul 2007 11:01:50 +0200
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:
// struct in6_addr address_;
- (NSString *) stringValue
{
char tBuffer[128];
if (IN6_IS_ADDR_LINKLOCAL(&address_) || IN6_IS_ADDR_MULTICAST
(&address_))
{
address_.__u6_addr.__u6_addr8[3]=0;
}
if (inet_ntop(AF_INET6,&address_,tBuffer,128)!=NULL) // *******
This is where the warning is reported.
{
return [NSString stringWithUTF8String:tBuffer];
}
return nil;
}
Yet according to the man page:
The function inet_ntop() converts an address *src from network format
(usually a struct in_addr or some other binary form, in network byte
order) to presentation format (suitable for external display purposes).
The size argument specifies the size, in bytes, of the buffer *dst. It
returns NULL
and headers:
const char *inet_ntop(int, const void *, char *, size_t);
the code looks correct.
I am probably missing something obvious or there's a bug in gcc.
_______________________________________________
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