Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!nstn.ns.ca!news.cs.indiana.edu!samsung!rex!wuarchive!zaphod.mps.ohio-state.edu!uwm.edu!bionet!agate!darkstar!terra.ucsc.edu!daniel From: daniel@terra.ucsc.edu (Daniel Edelson) Newsgroups: comp.std.c Subject: translation phases Message-ID: <12696@darkstar.ucsc.edu> Date: 22 Feb 91 18:24:41 GMT Sender: usenet@darkstar.ucsc.edu Reply-To: daniel@terra.ucsc.edu (Daniel Edelson) Organization: University of California, Santa Cruz Lines: 35 Can someone please tell me if this is a correct interpretation of section 2.1.1.2 of the standard. (I apologize if this is something that has been thrashed to death already in this newsgroup.) According to the translation phases, line splicing occurs before escape sequence replacement. Therefore, a '\\newline' sequence in a character or string constant should translate to a single backslash. This will be a syntax error unless it is part of a valid escape sequence. In particular: char msg[] = "\\ t"; This should translate to: msg[0] = '9'; /* tab */ msg[1] = '0'; /* null sentinel */ rather than msg[0] = '92'; /* backslash */ msg[1] = '10'; /* newline */ msg[2] = '116'; /* `t' */ msg[3] = '0'; /* null sentinel */ Thanks, Daniel Edelson uunet!peren!daniel or daniel@cis.ucsc.edu