[Xorp-cvs] XORP cvs commit: xorp xorp/cli/libtecla xorp/fea xorp/libxorp xorp/utils/flower_malloc

Bruce M. Simpson bms at icir.org
Fri Apr 20 22:44:40 PDT 2007


Pavlin Radoslavov wrote:
> Can you elaborate about the particular difference?
>   


S/POSIX/C99/

http://msdn2.microsoft.com/en-us/library/2ts7cx93(vs.71).aspx
 - MSVC spec

http://www.opengroup.org/onlinepubs/009695399/functions/snprintf.html
 - Open Group spec (aligned with ISO C99)

Yes, the MSVC runtime snprintf() doesn't conform to C99; it does not 
return the number of characters which would have been successfully 
written if the buffer size were sufficient.

A post here suggests that we may wish to rework that code anyway to use 
_scprintf():
    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=177815&SiteID=1

> BTW, all the changes with this particular commit don't consider the
> return value so we shouldn't see a problem on Windows.
>
> Indeed, the independently-updated local libxorp/inet_ntop.c
> implementation (from OpenBSD) considers the return value of
> snprintf(), but from what I can see the way
> "#ifndef HAVE_C99_SNPRINTF" is handled inside libxorp/c_format.cc,
> the libxorp/inet_ntop.c handling of snprintf() should be fine.
>   

No worries then!

Cheers,
BMS



More information about the Xorp-cvs mailing list