Skip Menu |
 

This queue is for tickets about the Socket CPAN distribution.

Report information
The Basics
Id: 82052
Status: resolved
Priority: 0/
Queue: Socket

People
Owner: Nobody in particular
Requestors: vpit [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 2.007
Fixed in: 2.008



Subject: Wrong format specifier causes two warnings
Download (untitled) / with headers
text/plain 721b
This is with clang on darwin, but most likely also happens with gcc -Wformat. Socket.xs:919:16: warning: format specifies type 'int' but the argument has type 'STRLEN' (aka 'unsigned long') [-Wformat] " got %d, should be 4", addrlen); ~^ ~~~~~~~ %ld Socket.xs:925:16: warning: format specifies type 'int' but the argument has type 'STRLEN' (aka 'unsigned long') [-Wformat] " got %d, should be 16", addrlen); ~^ ~~~~~~~ %ld There is a similar piece of code in inet_ntoa() from which you can steal to silence these warnings. Vincent
Subject: warn.txt
Download warn.txt
text/plain 532b
Socket.xs:919:16: warning: format specifies type 'int' but the argument has type 'STRLEN' (aka 'unsigned long') [-Wformat] " got %d, should be 4", addrlen); ~^ ~~~~~~~ %ld Socket.xs:925:16: warning: format specifies type 'int' but the argument has type 'STRLEN' (aka 'unsigned long') [-Wformat] " got %d, should be 16", addrlen); ~^ ~~~~~~~ %ld
Download (untitled) / with headers
text/plain 473b
On Mon Dec 17 11:39:03 2012, VPIT wrote: Show quoted text
> This is with clang on darwin, but most likely also happens with gcc > -Wformat. > > Socket.xs:919:16: warning: format specifies type 'int' but the argument > has type 'STRLEN' (aka 'unsigned long') [-Wformat] > " got %d, should be 4", addrlen);
Oops, classic mistake. Show quoted text
> There is a similar piece of code in inet_ntoa() from which you can steal > to silence these warnings.
Ahyes, will do. -- Paul Evans
Patched; will be in next release. -- Paul Evans
Subject: rt82052.patch
Download rt82052.patch
text/x-diff 602b
=== modified file 'Socket.xs' --- Socket.xs 2012-12-16 18:22:50 +0000 +++ Socket.xs 2012-12-17 22:52:32 +0000 @@ -916,13 +916,13 @@ case AF_INET: if(addrlen != 4) croak("Bad address length for Socket::inet_ntop on AF_INET;" - " got %d, should be 4", addrlen); + " got %"UVuf", should be 4", (UV)addrlen); break; #ifdef AF_INET6 case AF_INET6: if(addrlen != 16) croak("Bad address length for Socket::inet_ntop on AF_INET6;" - " got %d, should be 16", addrlen); + " got %"UVuf", should be 16", (UV)addrlen); break; #endif default:


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.