Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site wjh12.UUCP Path: utzoo!linus!vaxine!wjh12!kendall From: kendall@wjh12.UUCP (Sam Kendall) Newsgroups: net.lang.c Subject: %r, and why it disappeared (a theory) Message-ID: <333@wjh12.UUCP> Date: Thu, 13-Oct-83 02:18:14 EDT Article-I.D.: wjh12.333 Posted: Thu Oct 13 02:18:14 1983 Date-Received: Fri, 14-Oct-83 02:57:20 EDT Organization: Delft Consulting Corp., New York Lines: 27 As previously noted, %r takes as argument a char **, which is a pointer to a bunch of printf-style arguments, starting with a format string, on the stack. So %r can be used to write functions which take printf-like variable argument lists, and call printf to print them. THIS IS OTHERWISE IMPOSSIBLE, without either (1) rewriting printf and including the code in your function, or (2) calling _doprnt, the undocumented function shared by all printf and [sf]printf. (By the way, there was once an article on the net on how to use _dorpnt for this purpose. Maybe it should be re-submitted.) So %r is really useful. It was documented in PWB, if I remember correctly (can anyone check me there?); but why was it subsequently un-documented, and then removed? Well, the problem with %r is that it CANNOT be implemented on one system, GCOS (a Honeywell somethingorother). Maybe it was removed from USG UNIX because USG wants their UNIX to be portable, even to GCOS. On the other hand, perhaps it was just un-documented accidentally, and then removed because it was undocumented. But it is (was) so useful! And it could be respecified to be portable using the usually undocumented varargs(3) package. I am told that Andrew Koenig (sp?) is the author both of the varargs(3) package and of the System III printf. Perhaps he can shed some light on this. Can someone ask him? Sam Kendall {allegra,ihnp4}!wjh12!kendall Delft Consulting Corp. decvax!genrad!wjh12!kendall