Xref: utzoo comp.lang.c:10421 comp.std.c:25 Path: utzoo!attcan!uunet!husc6!bloom-beacon!mit-eddie!bbn!rochester!pt.cs.cmu.edu!k.gp.cs.cmu.edu!jgm From: jgm@k.gp.cs.cmu.edu (John Myers) Newsgroups: comp.lang.c,comp.std.c Subject: Re: #pragma Message-ID: <1770@pt.cs.cmu.edu> Date: 26 May 88 21:07:11 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> Sender: netnews@pt.cs.cmu.edu Followup-To: comp.std.c Organization: System/Technology Development Corp. Lines: 34 In article <7960@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: >In article <2765@umd5.umd.edu> chris@trantor.umd.edu (Chris Torek) writes: >>I took advantage of that clause to make a version of cpp which >>warns about #pragma. The reasoning works as follows: The >>`implementation-defined' manner can be almost anything (GNU cpp >>runs rogue, which appears to be perfectly legal), so long as the >>compiler `recognises' the #pragma. > >The GNU C preprocessor does NOT run rogue when #pragma is >encountered. [...] You cannot understand it while applying >tunnel vision, taking one part of the specification, dropping >its context, and attempting to make sense of what remains by >linguistic analysis. While it may be illegal to exec rogue when #pragma is encountered (the standard needs to be clarified on this point and even then will probably be ignored for the most part--witness the "#pragma noalias" suggestions.), I fail to see how the standard can prohibit an implementation from issuing a warning in this case. As long as the compiler produces output which conforms to the rest of the spec, I see no reason why it can't take the 'implementation-defined' action of generating a warning, as long as the warning is properly worded (i.e. "unsupported pragma" instead of "unrecognized pragma"). The "be quiet on unrecognized pragma" requirement is a tautology: "You're allowed to do something, but if you don't do anything, you have to do nothing." -- _.John G. Myers Internet: John.Myers@cs.cmu.edu LoseNet: ...!seismo!hao!wiscvm.wisc.edu!k!nobody -- _.John G. Myers Internet: John.Myers@cs.cmu.edu LoseNet: ...!seismo!hao!wiscvm.wisc.edu!k!nobody