[PATCH] tcp.c: elimiate warining "format '%ld', but argument has type 'ssize_t'

Frank Cusack fcusack at fcusack.com
Mon Feb 1 20:30:04 CET 2010


On February 1, 2010 11:40:01 AM +0100 Alan DeKok 
<aland at deployingradius.com> wrote:
> Wang Tinggong wrote:
>> -		DEBUG(", id=%d, length=%ld\n", packet->id, packet->data_len);
>> +		DEBUG(", id=%d, length=%d\n", packet->id, packet->data_len);
>
>   This depends strongly on your local system.  There's no need for the
> patch to fix a compiler warning.

Yup.  If anything, the patch should use the inttypes.h specifiers
(PRId32 et al), not changing from one platform-specific format
to another.  Well I'm assuming that packet->data_len is a fixed-size
type like int32.  If it is in fact a long than %ld is correct,
ovbiously.

-frank



More information about the Freeradius-Devel mailing list