[quagga-dev 4375] Re: bgpd printf size_t warning

Greg Troxel gdt at ir.bbn.com
Wed Sep 20 15:47:11 BST 2006


  Understood.  I'm not trying to be difficult, just trying to arrive
  at a consensus on the canonically correct way to printf a size_t
  (until such time as %z is available on all supported platforms).
  Is there some better way then using %lu and casting to (u_long)?

Absent %z, I think that's the best thing to do (assuming u_long is a
quagga typedef for unsigned long).   For %z, we need to have a
rational documented decision as to platform requirements.  This seems
to be C99, based on the NetBSD printf(3) (which documents %z):

STANDARDS
     The fprintf(), printf(), sprintf(), vprintf(), vfprintf(), and vsprintf()
     functions conform to ISO/IEC 9899:1990 (``ISO C90'').  The conversion
     format modifiers %j, %t and %z conform to ISO/IEC 9899:1999
     (``ISO C99'').  The snprintf() and vsnprintf() functions conform to
     ISO/IEC 9899:1999 (``ISO C99'').

I just looked and we already claim to require C99.

Is %z unsupported on any platform quagga currently works on?

-- 

    Greg Troxel <gdt at ir.bbn.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 185 bytes
Desc: not available
URL: <http://lists.quagga.net/pipermail/quagga-dev/attachments/20060920/91e679f2/attachment-0001.sig>


More information about the Quagga-dev mailing list