The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: <ron@ronnatalie.com>
To: "'Dave Horsfall'" <dave@horsfall.org>,
	"'The Eunuchs Hysterical Society'" <tuhs@tuhs.org>
Subject: Re: [TUHS] Any Good dmr Anecdotes?
Date: Sun, 1 Jul 2018 07:34:58 -0400	[thread overview]
Message-ID: <009101d4112f$8bb30f50$a3192df0$@ronnatalie.com> (raw)
In-Reply-To: <alpine.BSF.2.21.999.1807011523270.68695@aneurin.horsfall.org>

Printf didn't use nargs (and still doesn't).    It looked at the presence of the % markers and assumes that’s how many arguments were passed.
It worked on the PDP-11 or any similar stack calling sequence.   It was only after C got moved to some of the more varied architectures that
VARARGS/STDARG was implemented to achieve some level of variable argument portability.   Even so, there's not a concept of "nargs" to this day.

The PDP-11 nargs was a kludge that looked at the calling code.   This obviously didn't work if you were in split I-D mode (where you couldn't address the
i-space).    There was a published hack to rewire the processor to allow MTPI to work in user mode from your OWN I space to make it work.

The bigger issue with the early printf is it just called putchar and putchar only output to stdout or what ever the global fout variable was set to.
There was a comment in the manual that the fout concept was kludgy.


-----Original Message-----
From: TUHS <tuhs-bounces@minnie.tuhs.org> On Behalf Of Dave Horsfall
Sent: Sunday, July 1, 2018 1:30 AM
To: The Eunuchs Hysterical Society <tuhs@tuhs.org>
Subject: Re: [TUHS] Any Good dmr Anecdotes?

On Sat, 30 Jun 2018, Arrigo Triulzi wrote:

> As I was told this visitor was the R in the “K&R” book I felt I could 
> finally ask “someone who knew” how printf() worked with a variable 
> number of arguments.

It wouldn't've used that awful nargs() call at that time, would it?  I was glad when that horror was removed.

-- Dave


  parent reply	other threads:[~2018-07-01 11:53 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-29  7:53 Warren Toomey
2018-06-29 10:53 ` ches@Cheswick.com
2018-06-29 12:51   ` John P. Linderman
2018-06-30  0:50   ` Steve Johnson
2018-06-30 11:44     ` Arrigo Triulzi
2018-06-30 22:42       ` Arthur Krewat
2018-06-30 23:29         ` Arrigo Triulzi
2018-07-01  4:17           ` Larry McVoy
2018-07-01 11:42           ` ron
2018-07-01  5:29       ` Dave Horsfall
2018-07-01  8:28         ` Arrigo Triulzi
2018-07-01 11:34         ` ron [this message]
2018-07-09 16:30           ` Random832
2018-07-09 17:13             ` Clem Cole
2018-07-10  5:54               ` arnold
2018-07-10  6:09                 ` George Michaelson
2018-07-10  7:19                   ` arnold
2018-07-11  0:20                     ` Noel Hunt
2018-07-11  1:31                       ` Larry McVoy
2018-07-11  1:37                         ` George Michaelson
2018-07-11  1:37                         ` ron minnich
2018-07-11  3:12                           ` Larry McVoy
2018-07-11  3:34                         ` [TUHS] getopt (was " Bakul Shah
2018-07-13  9:08                       ` [TUHS] " ches@Cheswick.com
2018-07-13 14:10                         ` ron
2018-07-10 14:10                 ` Clem Cole
2018-07-03 17:34       ` Perry E. Metzger
2018-06-29 23:55 ` Dave Horsfall
2018-06-30  0:06   ` Greg 'groggy' Lehey
2018-06-30 14:20   ` John P. Linderman
2018-06-30  1:31 Larry McVoy
2018-06-30  1:45 ` Jon Forrest
2018-06-30 18:43   ` Steve Johnson
2018-07-01 16:35 Norman Wilson
2018-07-02 19:55 Paul Ruizendaal
2018-07-03  7:27 arnold
2018-07-18  9:42 Hendrik Jan Thomassen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='009101d4112f$8bb30f50$a3192df0$@ronnatalie.com' \
    --to=ron@ronnatalie.com \
    --cc=dave@horsfall.org \
    --cc=tuhs@tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).