Path: utzoo!attcan!uunet!husc6!mailrus!ames!umd5!trantor.umd.edu!chris From: chris@trantor.umd.edu (Chris Torek) Newsgroups: comp.lang.c Subject: #pragma Message-ID: <2765@umd5.umd.edu> Date: 23 May 88 14:44:55 GMT References: <54080@sun.uucp> <11608@mimsy.UUCP> <7950@brl-smoke.ARPA> <1988May23.012636.1719@utzoo.uucp> Sender: news@umd5.umd.edu Reply-To: chris@trantor.umd.edu (Chris Torek) Organization: University of Maryland, College Park Lines: 18 In article <1988May23.012636.1719@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes: >... Compilers are required to ignore unrecognized #pragmas >(although I for one think a warning message is in order...) .... >The description [in the dpANS] of #pragma just says "causes the >implementation to behave in an implementation-defined manner". 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. Hence we simply `recognise' it by (in theory) comparing it with a regular expression---to wit, `.*'---and print `#pragma noticed and nothing else done' as our implementation-defined action. -- In-Real-Life: Chris Torek, Univ of MD Computer Science, +1 301 454 7163 Domain: chris@mimsy.umd.edu Path: ...!uunet!mimsy!chris