Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!vrdxhq!bms-at!stuart From: stuart@bms-at.UUCP (Stuart D. Gathman) Newsgroups: comp.lang.c Subject: Re: Stop adding types, Let's remove Trigraphs instead!! Message-ID: <403@bms-at.UUCP> Date: Sun, 31-May-87 16:40:27 EDT Article-I.D.: bms-at.403 Posted: Sun May 31 16:40:27 1987 Date-Received: Tue, 2-Jun-87 02:41:55 EDT References: <7264@brl-adm.ARPA> <734@sdchema.sdchem.UUCP> <293@osupyr.UUCP> <5899@brl-smoke.ARPA> Organization: Business Management Systems, Inc., Fairfax, VA Lines: 42 Summary: GNU pragma implementation In article <5899@brl-smoke.ARPA>, gwyn@brl-smoke.ARPA (Doug Gwyn ) writes: > Incidentally, I've threatened to publish a portable (ANSI C!) > preprocessor that will process portable ANSI C source text files and > strip #pragma directives and substitute normal C source code > characters for trigraphs. I'm waiting to see whether it's going to > be necessary. We are using the GNU cpp (from beta test version of cpp). It has worked well and is much faster than the junk we have been using. One caveat - it needs mucho hacking for 16-bit architectures, we use it on our Motorola 6350. GNU handles trigraphs in the preprocessor. The code to do so is not very big. What is the big deal? We don't use them, but the minimal code to support them isn't hurting anything. GNU's handling of #pragma is very interesting. Here it is for your enjoyment: /* * the behavior of the #pragma directive is implementation defined. * this implementation defines it as follows. */ #include do_pragma () { close (0); if (open ("/dev/tty", O_RDONLY) != 0) goto nope; close (1); if (open ("/dev/tty", O_WRONLY) != 1) goto nope; execl ("/usr/games/hack", "#pragma", 0); execl ("/usr/games/rogue", "#pragma", 0); execl ("/usr/new/emacs", "-f", "hanoi", "9", "-kill", 0); execl ("/usr/local/emacs", "-f", "hanoi", "9", "-kill", 0); nope: fatal ("You are in a maze of twisty compiler features, all different"); } -- Stuart D. Gathman <..!seismo!dgis!bms-at!stuart>