🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5065

Re: #pragma

#5065
From: John Myers
Date: Tue, 31 May 1988 00:37
35 lines
2277 bytes
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
Technical Details
Message-ID: <1803@pt.cs.cmu.edu>
Path: arc1-ca.pugleaf.net!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
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>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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