>From the z/OS V2R2 XLC User's Guide:

Compiler options that you specify on the command line or in the CPARM
parameter of IBM-supplied cataloged procedures can override compiler options
that are used in #pragma options. The exception is CSECT, where the #pragma
csect directive takes precedence.

Despite the "can" I think they mean "do."

Charles

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf 
Of Elardus Engelbrecht
Sent: Wednesday, November 25, 2015 11:39 AM
To: [email protected]
Subject: Re: Any clever way to defeat the C compiler's options precedence?

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. 

Disclaimer! I worked with C, not C++. 

What you said is a discovery at least to me. I also find it ghastly backward. 
At least in other languages, you can setup your compile parameters globally 
somewhere and then override them inside your source one by one.

Question - with what C / C++ compiler did you experience that weirdo setup? On 
what z/Os version?

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to