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

Alan DeKok aland at deployingradius.com
Mon Feb 1 20:39:25 CET 2010


Frank Cusack wrote:
> 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.

  I took a look... it's size_t.  Which is 0-4K for any RADIUS packet.

  The "portable" fix is to change %ld to %d, and to add an explicit
cast: (int) packet->data_len.

  Casts are annoying, but safe here.

  Alan DeKok/




More information about the Freeradius-Devel mailing list