Add __attribute__ ((format)) and fix problem it flags.

This commit is contained in:
ehouse 2008-03-10 12:02:53 +00:00
parent 559700e27b
commit bc873169f1
2 changed files with 4 additions and 3 deletions

View file

@ -248,8 +248,8 @@ linux_udp_send( const XP_U8* buf, XP_U16 buflen, const CommsAddrRec* addrp,
}
if ( haveAddress ) {
XP_LOGF( "calling sendto: sock=%d; port=%d; ipaddr=%lx", stuff->socket,
ntohs(to.sin_port), to.sin_addr.s_addr );
XP_LOGF( "calling sendto: sock=%d; port=%d; ipaddr=%x",
stuff->socket, ntohs(to.sin_port), to.sin_addr.s_addr );
nSent = sendto( stuff->socket, buf, buflen, 0,
(struct sockaddr*)&to, sizeof(to) );
if ( nSent != buflen ) {

View file

@ -61,7 +61,8 @@ typedef unsigned long XP_Time;
#define XP_LOGF XP_DEBUGF
#ifdef DEBUG
extern void linux_debugf(char*, ...);
extern void linux_debugf(const char*, ...)
__attribute__ ((format (printf, 1, 2)));
#define XP_DEBUGF(...) linux_debugf(__VA_ARGS__)
#else