Newsgroups: comp.lang.c Path: utzoo!utgpu!jarvis.csri.toronto.edu!dgp.toronto.edu!hugh From: hugh@dgp.toronto.edu ("D. Hugh Redelmeier") Subject: Re: Trigraphs -- some numbers Message-ID: <8805271448.AA09761@explorer.dgp.toronto.edu> Organization: University of Toronto, CSRI References: <847@fig.bbn.com> Date: Fri, 27 May 88 09:28:42 EDT In article <847@fig.bbn.com> rsalz@bbn.com (Rich Salz) writes: >I logged on to the machine that has our Sun3.2 sources and did > find . -type f -print | xargs fgrep '??' >/tmp/tri > vi /tmp/tri # to remove comments, etc. Ah, but trigraphs are converted in comments too! Consider the following: /* This comment ends only if trigraphs are handled correctly *??/ / >Most uses fall into these two types: > printf("%s", ptr ? ptr->field : "???"); > static char tty[] = "/dev/tty??"; Notice that ??" is not a trigraph, so these examples are no problem. I recently checked about 15000 lines of my own code, and found only one (accidental) trigraph. It was in a comment, and treating it as a trigraph had no effect: /* no value will be greater than 10 (really???) */ Hugh Redelmeier {utcsri, utzoo, yunexus, hcr}!redvax!hugh In desperation: hugh@csri.toronto.edu +1 416 482 8253