Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!ogicse!ogicse.cse.ogi.edu!morgan From: morgan@ogicse.cse.ogi.edu (Clark O. Morgan) Newsgroups: comp.std.c Subject: implicitly continued string constants Message-ID: <21455@ogicse.ogi.edu> Date: 15 May 91 08:24:40 GMT Sender: morgan@ogicse.ogi.edu Organization: Oregon Graduate Institute (formerly OGC), Beaverton, OR Lines: 31 I noticed the other day that gcc (version 1.39) does not error implicitly continued string constants (e.g., string constants that contain actual newlines). This surprised me, because I personally consider such strings to be programming typos, especially given the alternatives available for continuing long strings (i.e., concatenation or continuation with an explicit \n). I have been told that gcc is ANSI C compatible. So here's the question, is the following program legal ANSI C? Script started on Wed May 15 00:43:44 1991 $ cat -n t.c 1 extern int printf(char *, ...); 2 3 int 4 main() 5 { 6 printf("junk); 7 string\n"); 8 return (0); 9 } $ gcc -Wall t.c <--- No complaints $ a.out junk); string $ exit script done on Wed May 15 00:44:09 1991 Thanks in advance.