Path: utzoo!attcan!uunet!husc6!mailrus!ames!necntc!ima!haddock!karl From: karl@haddock.ISC.COM (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: Trigraphs and Pragmas Message-ID: <4313@haddock.ISC.COM> Date: 1 Jun 88 00:17:10 GMT References: <6757@cit-vax.Caltech.Edu> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 19 In article <6757@cit-vax.Caltech.Edu> beckenba@cit-vax.UUCP (Joe Beckenbach) writes: >To add to trigraph sequences, perhaps something like: > #pragma trigraph LBRACE &< >to allow &< to map to { [notice &< is never legal C!] Allowing the character set to change mid-stream would create a whole new mess of problems. (Even the simple "#pragma trigraphs off" is troublesome, since trigraphing precedes comment removal which precedes preprocessor action.) Given the constraint that trigraphs are staying in the language, I think that the best solution is: (users:) make sure your code doesn't contain "accidental trigraphs" (sed -e "s;??\\([-=(/)']\\);?\\\\?\\1;g" will fix them), and (implementors:) issue a warning if a file contains both trigraphs and trigraphable characters. Ignoring that constraint, I think that the best solution is to remove them. I'll discuss this in a separate posting. Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint