Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.lang.c,net.unix-wizards,net.wanted Subject: Re: need info: %r in printf Message-ID: <3251@utzoo.UUCP> Date: Thu, 13-Oct-83 16:03:23 EDT Article-I.D.: utzoo.3251 Posted: Thu Oct 13 16:03:23 1983 Date-Received: Thu, 13-Oct-83 16:03:23 EDT References: fortune.1587, <2151@yale-com.UUCP> Organization: U of Toronto Zoology Lines: 18 The reason (well, I think the major reason) why %r has gone away in recent years is that it is not really portable. The trick of calling a routine with a variable number of parameters, while the routine declares only one parameter and invokes printf %r with the address of that parameter, is nifty and neat but absolutely requires some highly machine-dependent assumptions about calling sequences. There is no truly machine-independent way to do this trick without help from the language, help which C does not provide. The only thing you can really do about it is to sprintf into a string and then pass that. (Yes, I know, it's not as convenient.) Please, no questions about why a machine-dependent construct like this is in DECUS C. Either they didn't know what they were doing, or they didn't care (anyone using a DEC operating system obviously isn't worried about portability anyway, right?). -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry