On 25 November 2015 at 14:24, Charles Mills <charl...@mcn.org> wrote: > The C/C++ compiler lets you set options globally with PARM= or DD:OPTFILE > (or equivalently on a UNIX command line for those who like that sort of > thing). You can also specify most options *first thing* in a source module > with #pragma OPTIONS. > > The former overrides the latter. It seems to me that is backwards. I want to > compile all of my modules with OPTION FOO, except one module that I want to > compile with OPTION NOFOO. I would like to specify PARM=FOO globally and > specify #pragma OPTIONS ( NOFOO ) in the one module. Doesn't that sound > reasonable?
This seems incomprehensively BAD (Broken As Designed). Do other IBM compilers behave this way? Surely this is worth complaining about, even if that process is too slow for your current problem. The High Level Assembler does it about right, as you doubtless know. Quote from the book:: ====== Assembler options are recognized in this order of precedence (highest to lowest): Fixed installation default options Options on *PROCESS OVERRIDE statements Options in the ASMAOPT file (CMS or z/OS) or library member (z/VSE) Invocation options Options on the JCL PARM parameter of the EXEC statement on z/OS and z/VSE, or the ASMAHL command on CMS Options on the JCL OPTION statement (z/VSE) Options specified via the STDOPT (Standard JCL Options) command (z/VSE) Options on *PROCESS statements Non-fixed installation default options You can specify an option as often as you want, and in as many sources as you want. However, this may mean that you have specified the positive and negative form of an option (for keyword pairs), or two or more different values (for a value keyword). These option specifications are "conflicting" options. If all specifications of a particular option are at the same level of precedence, the last specification takes effect, and a warning message is issued. If some conflicting specifications are at different levels of precedence, then the specification at the higher order of precedence takes effect, and (in general) the assembler issues a warning message for each option that is not accepted. A warning message is not issued if the higher level of precedence is a *PROCESS OVERRIDE statement, unless the option cannot be set by a *PROCESS statement. ====== Effectively the above is saying that the equivalent of a C #pragma can be coded so as to override the global or other "per compile" options, except for an option chosen at compiler installation to not be overridable. Probably that's what C needs. HLASM also has an option (PCONTROL) to override the value of various operands of the PRINT statement. PRINT is very widely used, and controls six or so details of what gets shown in the listing. It can be very handy during testing and "for the record" building, but I'm not sure there is a meaningful C equivalent. Tony H. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN