Yes. Very much like what I do. But it is the framework of the problem, not the solution. Here is the problem:
I want to compile the bulk of my modules by default ARCH(9) (changeable from time to time) but two of them ARCH(5). Should be simple enough, right? (Why? See related thread. I want to deal gracefully with a machine whose ARCH level is lower than my build level. I want my main and the "deal with it" module to be able to run without a S0C1 on any "z" machine.) - You can't do the obvious: put ARCH(9) in OPTF and #pragma options ( ARCH(5) ) in the two because PARM=/OPTF overrides #pragma options -- the main subject of this thread. - I thought I was going to solve it by putting #pragma options ( ARCH(9) ) in a "universal" header and #ifdef around it in the two modules, ... BUT - #pragma OPTIONS is C only and my code is 98% C++. I could make one of the two C and split the other one up so part of it was C, but that still leaves me with no way of specifying ARCH(9) for the bulk of the modules. - Wait! IBM thoughtfully provided #pragma option_override! It overrides what was specified on PARM=/OPTF. It's C and C++. Sounds perfect, right? But no ... it only supports the optimization options, and ARCH is in this compiler's world not an optimization option -- only compact, level, spill and strict. - I am about convinced I can't get there from here. Does my problem seem that unreasonable? Charles -----Original Message----- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of David Crayford Sent: Thursday, November 26, 2015 5:27 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Any clever way to defeat the C compiler's options precedence? Isn't this a bit of a no-brainer just using JCL? //CPROC PROC M=,PARMS= //COMPILE EXEC PGM=CCNDRVR,REGION=0M, // PARM=('EXPORTALL OPTF LOC(EN_US.IBM-037) &PARMS') //SYSMSGS DD DUMMY //USERLIB DD DISP=SHR,DSN=DOC.USER.H // DD DISP=SHR,DSN=COM110.WDOC.H // DD DISP=SHR,DSN=COM110.DEVT.H //SYSOPTF DD * ARCH(9) RENT,SS,NOSEQ,NOMARG,STA,LO, SE(*),LSE(*),GOFF,SO,LIST,LANG(EXTC99) DEF(_XOPEN_SOURCE_EXTENDED) //SYSIN DD DISP=SHR,DSN=COM110.DEVT.C(&M) //SYSLIN DD DISP=SHR,DSN=COM110.WDOC.COBJECT(&M) //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //SYSCPRT DD SYSOUT=* //* // PEND //* //COMCISPF EXEC CPROC,M=COMCISPF,PARMS='ARCH(5)' //COMDLL EXEC CPROC,M=COMDLL //COMDLLI EXEC CPROC,M=COMDLLI //COMDLLS EXEC CPROC,M=COMDLLS //COMDSN EXEC CPROC,M=COMDSN //COMHMAP EXEC CPROC,M=COMHMAP On 26/11/2015 3:24 AM, Charles Mills 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? > > Am I RTFM incorrectly? Or has anyone figured out a bit of cleverness > to have global "default" options that one can override on a source > module by source module basis. (I have common JCL that I use > "universally." I have hundreds of source modules. I don't have > hundreds of "compile jobs.") > > Thanks, > > Charles > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, send > email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN