🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #6147

Re: Escape sequences for printf() defined by SVID

#6147
From: Doug Gwyn
Date: Fri, 05 Jan 1990 01:45
21 lines
1692 bytes
In article <1990Jan3.144808.6319@sssab.se> sveer@sssab.se (Sven L Eriksson) writes:
>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.

You're right about the SVID (Issue 3 as well as Issue 2) implying that
the two adjacent character codes '\' and 'n' in the format string are
treated as meaning "output a new-line".  However, that is simply a
mistake in the SVID, which should have called these "control characters"
or better yet have described the control actions separately from the
printf() description.

In fact, such an implementation would run directly counter to the C
Standard (which requires that these "ordinary characters" be output
without interpretation by printf()), and AT&T has indicated that that
was NOT their intent.

Presumably, if you bring this to AT&T's attention it might get fixed
in a future Issue of the SVID.
Technical Details
Message-ID: <11878@smoke.BRL.MIL>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn
References: <1990Jan3.144808.6319@sssab.se>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn
From: gwyn@smoke.BRL.MIL (Doug Gwyn)
Newsgroups: comp.std.c
Subject: Re: Escape sequences for printf() defined by SVID
Keywords: escape sequences printf SVID
Message-ID: <11878@smoke.BRL.MIL>
Date: 5 Jan 90 01:45:22 GMT
References: <1990Jan3.144808.6319@sssab.se>
Reply-To: gwyn@brl.arpa (Doug Gwyn)
Distribution: comp
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 21