need info: %r in printf

eric at washu.UUCP eric at washu.UUCP
Fri Oct 14 03:21:40 AEST 1983


The C-compiler at BBN allowed the %R or %r construction, but I believe
it was a local hack.  You can get the same results as follows (although
it is a bit less beautiful):

	char *ProgramName;
	warning(fmt,args)
	char *fmt;
	{

	  fprintf(stderr,"%s: (warning) ",ProgramName);
	  _doprnt(fmt, &args, stderr);		/* this is the good line */
	  return(ferror(stderr)? EOF : 0);
	
	}

On 4.1 at least, no special libs need be included.

eric
..!ihnp4!washu!eric-- 
eric
..!ihnp4!washu!eric



More information about the Comp.unix.wizards mailing list