Escape sequences for printf() defined by SVID

Sven L Eriksson sveer at sssab.se
Thu Jan 4 01:48:08 AEST 1990


Everybody knows that escape sequences like these works fine with printf

	printf("\thello\n") ;

Usually these escape sequences are recognized and converted by the
compiler.

However SVID (Issue 2) states that the format string may contain these
escape sequences. This implies that it is possible for the actual
format string printf sees to contain the characters '\' and 'n', and
still be converted into a newline. This whould be very convenient if
the format string is received from elsewhere, e.g. stdin.

(X/Open portability guide (issue 2) does not mention these escape
sequences, but says that the printf() chapter is derived from SVID
issue 1.)

Is this a correct interpretation that printf() (according to SVID)
should handle escape sequences or is SVID wrong?

-- 
- Sven L Eriksson, 3S AB (Scandinavian System Support AB)
- Address: Agatan 4, Box 535, S-581 05 Linkoping, Sweden
- Phone: +46-13-11 16 60      Fax: +46-13-11 51 93
- Email: sveer at sssab.se       UUCP: uunet!mcvax!sssab!sveer



More information about the Comp.std.c mailing list