-qsaveopt

Pragma equivalent

None.

Purpose

Saves the command-line options used for compiling a source file, the user's configuration file name and the options specified in the configuration files, the version and level of each compiler component invoked during compilation, and other information to the corresponding object file.

Syntax

Read syntax diagramSkip visual syntax diagram
        .-nosaveopt-.   
>>- -q--+-saveopt---+------------------------------------------><

Defaults

-qnosaveopt

Usage

This option has effect only when compiling to an object (.o) file (that is, using the -c option). Though each object might contain multiple compilation units, only one copy of the command-line options is saved. Compiler options specified with pragma directives are ignored.

Command-line compiler options information is copied as a string into the object file, using the following format:
Read syntax diagramSkip visual syntax diagram
>>-@(#)--opt--+-f-+--invocation--options-----------------------><
              +-c-+                        
              '-C-'                        

Read syntax diagramSkip visual syntax diagram
>>-@(#)--cfg----config_file_options_list-----------------------><

Read syntax diagramSkip visual syntax diagram
>>-@(#)--env----env_var_definition-----------------------------><

where:
f
Signifies a Fortran language compilation.
c
Signifies a C language compilation.
C
Signifies a C++ language compilation.
invocation
Shows the command used for the compilation, for example, xlc.
options
The list of command line options specified on the command line, with individual options separated by space.
config_file_options_list
The list of options specified by the options attribute in all configuration files that take effect in the compilation, separated by space.
env_var_definition
The environment variables that are used by the compiler. Currently only XLC_USR_CONFIG is listed.
Note: You can always use this option, but the corresponding information is only generated when the environment variable XLC_USR_CONFIG is set.

For more information about the environment variable XLC_USR_CONFIG, see Compile-time and link-time environment variables.

Note: The string of the command-line options is truncated after 64,000 bytes.
Compiler version and release information, as well as the version and level of each component invoked during compilation, are also saved to the object file in the format:
Read syntax diagramSkip visual syntax diagram
>>-@(#)--------------------------------------------------------->

   .-------------------------------------------------------------------------------------------------------------.   
   V                                                                                                             |   
>----version--+-Version-- : -VV.RR.MMMM.LLLL-------------------------------------------------------------------+-+-><
              '-component_name--Version--:--VV.RR--(--product_name--)--Level--:--YYMMDD--:--component_level_ID-'     

where:
V
Represents the version.
R
Represents the release.
M
Represents the modification.
L
Represents the level.
component_name
Specifies the components that were invoked for this compilation, such as the low-level optimizer.
product_name
Indicates the product to which the component belongs (for example, C/C++ or Fortran).
YYMMDD
Represents the year, month, and date of the installed update. If the update installed is at the base level, the level is displayed as BASE.
component_level_ID
Represents the ID associated with the level of the installed component.

If you want to simply output this information to standard output without writing it to the object file, use the --version (-qversion) option.

Predefined macros

None.

Examples

Compile t.c with the following command:
xlc t.c -c -qsaveopt -qhot
Issuing the strings -a command on the resulting t.o object file produces information similar to the following:
IBM XL C/C++ for Linux, Version 13.1.2.0
opt c /opt/ibm/xlC/13.1.2/bin/.orig/xlc \
-F/opt/ibm/xlC/13.1.2/etc/xlc.cfg.ubuntu.14.04.gcc.4.8.2 
hello.c -c -qsaveopt -qhot
cfg -qlanglvl=extc99 -qalias=ansi -D_REENTRANT -D__VACPP_MULTI__ 
-qtls -q64 -D_CALL_SYSV -D__null=0 -D__NO_MATH_INLINES -qnopic
-D_CALL_ELF=2 -Wno-parentheses -Wno-unused-value -qtls
version IBM XL C/C++ for Linux, V13.1.2 (5725-C73, 5765-J08)
version Version: 13.01.0002.0000
version Driver Version: 13.1.2(C/C++) Level: 140912 ID: _J5rfgDqqEeSrZfWh7nI0RA
version C/C++ Front End Version: 13.1.2(C/C++) Level: 140913 ID: _Kz9_wjuiEeSrZfWh7nI0RA
version High-Level Optimizer Version: 13.1.2(C/C++) and 15.1.2(Fortran) Level: 140911 
ID: _Jg1ehjniEeSrZfWh7nI0RA
version Low-Level Optimizer Version: 13.1.2(C/C++) and 15.1.2(Fortran) Level: 140912 
ID: _J6Z4MjqqEeSrZfWh7nI0RA

In the first line, c identifies the source used as C, /opt/ibm/xlC/13.1.2/bin/xlc shows the invocation command used, and -qhot -qsaveopt shows the compilation options.

The remaining lines list each compiler component invoked during compilation, and its version and level. Components that are shared by multiple products may show more than one version number. Level numbers shown may change depending on the updates you have installed on your system.

Related information



Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us