[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: vfprintf, scanf portability
From: |
Paul Eggert |
Subject: |
Re: vfprintf, scanf portability |
Date: |
Tue, 15 Mar 2011 12:08:53 -0700 |
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 Thunderbird/3.1.7 |
On 03/15/2011 11:34 AM, 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.
This refers to very old implementations where sprintf returned char *.
These aren't relevant any more; C89 killed those implementations off.
I would remove this.
Second:
Be aware that @code{vfprintf} is not always available.
That's a bit dated, but not entirely irrelevant. See, for example,
http://buildlogs.pld-linux.org/index.php?dist=th&arch=athlon&ok=1&name=gcc&id=78974776-f08b-4b31-a977-863793c73c22&action=text
a build dated March 2009, or
http://buildd.emdebian.org/~zumbi/toolchain/squeeze/i386/logs/i386-sparc-gcc-4.4.log
a build dated December 2010.