Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!brl-adm!adm!LINNDR%VUENGVAX.BITNET@wiscvm.wisc.EDU From: LINNDR%VUENGVAX.BITNET@wiscvm.wisc.EDU Newsgroups: comp.lang.c Subject: Use of #pragma Message-ID: <6966@brl-adm.ARPA> Date: Fri, 17-Apr-87 17:51:27 EST Article-I.D.: brl-adm.6966 Posted: Fri Apr 17 17:51:27 1987 Date-Received: Sun, 19-Apr-87 12:59:07 EST Sender: news@brl-adm.ARPA Lines: 44 In article <386@sdd.uucp> Daniel Corbett (dc@sdd.uucp) writes: > Why not utilize a #pragma NO_OPTIMIZE & a counter pragma #pragma OPTIMIZE >around code that is to executed as is Perhaps we can even create various >classes of pragmas for different optimizations: #pragma NO_OPTIMIZE LOOPS, >#pragma NO_OPTIMIZE_STRENGTH, etc. Since I don't have the dpANS nor the ready cash to get one, I may be asking a question already answered there. Is there a mechanism for allowing the temporary change of compilation state (presumably with #pragma)? In the context of the statements quoted above, could I turn optimization off around a particular set of statements and then return to the optimization state previously in effect? This is somewhat analogous to lambda-binding in LISP. If my question is unclear, maybe the following example will clarify. Suppose I have a file containing some expressions that should not EVER be optimized in the midst of expressions that might of might not be optimized depending on the command line arguments. I could have ! ! #pragma NO_OPTIMIZE ! ! #pragma OPTIMIZE ! optimized at the same level (2) as ? I realize the OPTIMIZE may not even be a pragma in a given compiler, but hopefully the more general question can be understood from this example. David Linn BITNET: LINNDR@VUENGVAX InterNet: LINNDR%VUENGVAX.BITNET@WISCVM.WISC.EDU UUCP: ...!psuvax1!vuengvax.bitnet!linndr AT&T (615)322-7924 USPS: P.O. 3241-B, Nashville, TN, 37235