[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: vfprintf, scanf portability
From: |
Eric Blake |
Subject: |
Re: vfprintf, scanf portability |
Date: |
Tue, 15 Mar 2011 12:39:47 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7 |
On 03/15/2011 12:34 PM, Karl Berry wrote:
> The GNU coding standards have had these two items since the beginning.
>
> First:
> Don't use the return value of @code{sprintf}. It returns the number of
> characters written on some systems, but not on all systems.
>
> I don't see this mentioned in the Gnulib entry for sprintf at
> http://www.gnu.org/software/gnulib/manual/html_node/sprintf.html
> Is it still relevant?
It is not relevant for sprintf. For snprintf, there are still buggy
implementations that don't always return the correct value mandated by
POSIX, but gnulib works around thos.
>
> Second:
> Be aware that @code{vfprintf} is not always available.
>
> Again, I don't see it mentioned in
> http://www.gnu.org/software/gnulib/manual/html_node/vfprintf.html
> though seemingly nearly every other system has some kind of problem.
> Is it still relevant?
Probably not any modern systems that lack vfprintf these days; however,
there are still a host of other modern portability problems to worry about.
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature