Article View: comp.std.c
Article #3556Re: printf() format extensions - looking for beta testers...
From: Larry Jones
Date: Sat, 13 Apr 1996 02:27
Date: Sat, 13 Apr 1996 02:27
35 lines
1862 bytes
1862 bytes
In article <4kgljv$l2p@solutions.solon.com>, seebs@solutions.solon.com (Peter Seebach) writes:
> format('!', bangcvt);
>
> /* do something which can generate an error */
> fprintf(stderr, "%s: %!\n", "open failed");
[...]
> (This example may not be correct, but is expected to give the idea of
> intended usage.)
A better example would have %! take one int argument:
fprintf(stderr, "%s: %!\n", "open failed", errno);
That avoids problems with errno having been changed before the
formatting function gets a chance to look at it. In particular, some
previous processing in fprintf may well have changed it.
[Good point. -mod]
> (Obviously, before any adoption occurs, it will be done with functions
> not named printf/fprintf/etc.)
I'm not sure what you mean by this -- are you going to propose a whole
new family of I/O functions rather than an extension to the existing
functions?
[I mean I currently have a library of fmt(), ffmt(), sfmt(), snfmt(),
vfmt(), ..., but that's a legality thing; the proposal would have that
functionality named printf(), fprintf(), ..., but I can't send out
reimplementations of library functions and expect it to work. -mod]
----
Larry Jones, SDRC, 2000 Eastman Dr., Milford, OH 45150-2789 513-576-2070
larry.jones@sdrc.com
I like Mom to be impressed when I fulfill the least of my obligations.
-- Calvin
Technical Details
Message-ID:
<4kn3ee$3o5@solutions.solon.com>Path:
arc1-ca.pugleaf.net!solon.com!not-for-mailReferences:
<4kgljv$l2p@solutions.solon.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail From: larry.jones@sdrc.com (Larry Jones) Newsgroups: comp.std.c,comp.lang.c.moderated Subject: Re: printf() format extensions - looking for beta testers... Date: 12 Apr 1996 21:27:26 -0500 Organization: SDRC Engineering Services Sender: clc@solutions.solon.com Approved: clc@solutions.solon.com Message-ID: <4kn3ee$3o5@solutions.solon.com> References: <4kgljv$l2p@solutions.solon.com> NNTP-Posting-Host: solutions.solon.com