Path: utzoo!attcan!uunet!husc6!uwvax!oddjob!ncar!ico!rcd From: rcd@ico.ISC.COM (Dick Dunn) Newsgroups: comp.lang.c Subject: Re: trigraphs in X3J11 Summary: Compiler switch would cause problems too Message-ID: <5391@ico.ISC.COM> Date: 25 May 88 00:16:53 GMT References: <5215@ico.ISC.COM>, <1490@eneevax.UUCP> <1988May23.000451.751@utzoo.uucp> Organization: Interactive Systems Corp, Boulder, CO Lines: 28 > > Our particular implimentation was controlled by an option flag, so it didn't > > harm native mode APL work. A clear deficiency in the ANSI proposal. > I would expect that this is the way many C compilers will implement trigraphs; > I know of some that already take that approach. Lots of people share your > view that trigraphs are ugly. Adding a compiler switch may be the "least bad" solution that a rational compiler writer can find...but it gives programmers an ugly choice: The compiler either transmogrifies trigraphs or it compiles programs in a nonstandard way. If the programmer writes: printf("What on earth??!\n"); a standard-conforming compiler should produce code which will cause the program to print: What on earth| If instead it produces code which causes the program to print: What on earth??! it's violating the standard. If you're compiling your own code, you know when to turn on the trigraph switch on the compiler...but if you're compiling jrandom.c that you got on a tape from somebody, what do you do? Is it a standard program? Was it written before the standard came out? (There are a couple of files in the netnews source which fall into just this hole.) -- Dick Dunn UUCP: {ncar,cbosgd,nbires}!ico!rcd (303)449-2870 ...If you get confused just listen to the music play...