Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!husc6!bbn!rochester!pt.cs.cmu.edu!k.gp.cs.cmu.edu!jgm From: jgm@k.gp.cs.cmu.edu (John Myers) Newsgroups: comp.std.c Subject: Re: #pragma Message-ID: <1803@pt.cs.cmu.edu> Date: 31 May 88 00:37:56 GMT References: <54080@sun.uucp> <11608@mimsy.UUCP> <7950@brl-smoke.ARPA> <1988May23.012636.1719@utzoo.uucp> <2765@umd5.umd.edu> <7960@brl-smoke.ARPA> <1770@pt.cs.cmu.edu> <522@sas.UUCP> Sender: netnews@pt.cs.cmu.edu Organization: System/Technology Development Corp. Lines: 35 In article <522@sas.UUCP> bts@sas.UUCP (Brian T. Schellenberger) writes: >In article <1770@pt.cs.cmu.edu> jgm@k.gp.cs.cmu.edu (John Myers) writes: >|While it may be illegal to exec rogue when #pragma is encountered [...] > >I fail to see how running rogue can be illegal if warnings are legal. So long >as it spawns a new process to run rogue, and the code produced by the >compiler (and interpretation of the rest of the program) does not depend on >the results of the rogue game, I can't see how the standard prohibits it. > >Yes, it's silly, but I still fail to see how it is prohibited. There's a subtle nit there: I said 'exec', not 'run'. The GNU C preprocessor used to dump you into some rogue-like game, *aborting* *compilation* when it encountered #pragma. As for the other case, I see nothing in the standard that would prohibit the compiler from spawning a new process to run rogue when it encounters, say, the "int" keyword, as long as it produces correct output. It just so happens that nobody would use such a compiler. Compilers can, do, and should produce warnings for what are perfectly legal C constructs. Whether or not a compiler should produce a warning for "unrecognized" #pragma's depends on what other compilers use it for. Given the various "make it a #pragma" suggestions I have seen, I would think that a warning would be justified. Of course, one should always be able to turn the warning off... -- _.John G. Myers Internet: John.Myers@cs.cmu.edu LoseNet: ...!seismo!hao!wiscvm.wisc.edu!k!nobody "Pascal toting bozos at M***W***" -- Z -- _.John G. Myers Internet: John.Myers@cs.cmu.edu LoseNet: ...!seismo!hao!wiscvm.wisc.edu!k!nobody