Subject: Re: printf formats again
To: None <current-users@NetBSD.ORG>
From: Peter Seebach <>
List: current-users
Date: 11/14/1996 09:04:15
>> something, or use the ugly string-concatenation hack that's used to
>> get around the lack of explicit termination for \x (i.e. "\xaa" "aa"
>> to avoid generating the "character" \xaaaa).)

>While I was reading what you wrote I had the same thought. Unfortunately
>it won't work. By the time that printf() gets your string it has been
>concatenated, and the termination has become unclear again.

So?  printf() doesn't handle \x.. Translation phases

	The precedence among the syntax rules of translation is specified by
	the following phases. [footnote: Implementations must behave as if
	these separate phases occur, even though many are typically folded
	together in practice.]

	5.  Each source character set member _and escape sequence_ in
	character constants and string literals is converted to a member of
	the execution character set.

	6.  Adjacent character string literal tokens are concatenated and
	adjacent wdie string literal tokens are concatenated.

The hack referred to works, ugly though it may be.

>The C++ method is ugly. I find printf() formats more readable,
>in many occasions (but not always).

>From my point of view, it's not just the readability, but the sheer idiocy of
attaching precision and width to a stream, not to a formatting of a given