HP 3000 Manuals

HP C/iX Compiler Options [ HP C/iX Reference Manual ] MPE/iX 5.0 Documentation


HP C/iX Reference Manual

HP C/iX Compiler Options 

You can pass options to the HP C/iX compiler in the INFO parameter of the
CCXL, CCXLLK, and CCXLGO commands, or using the INFO parameter of the RUN
command, if you invoke the compiler using CCOMXL.PUB.SYS. You must
separate options with a blank.  Any string of characters not separated
with a blank is considered a single option.  For example, -Wc,-r is
considered one option with -r as an argument to the option; it inhibits
the promotion of float to double.  In addition, note that the case of the
options is significant.

The following options are available: 

       Option                                   Description 

-A level              where level can be a or c.

    a                 Requests a compilation on ANSI C mode.

                      By using the -Aa option, you are requesting a strict
                      implementation of ANSI C. ANSI C specifies which names are
                      available in the standard libraries and headers, which are
                      reserved for the implementation, and which must be left
                      available for the user.  HP C/iX in ANSI mode conforms to these
                      restrictions, and only names permitted by ANSI C are defined or
                      declared in the standard libraries and headers.

                      However, if you want to compile using ANSI mode but want the
                      naming restriction relaxed, you can include the following line
                      in the start of your source before including any header files:

                           #define _MPEXL_SOURCE

                      This will allow you to gain access to names that are legal in
                      non-ANSI mode.

    c                 This is a non-ANSI implementation and the default compilation
                      mode.

-C                    Prevents the preprocessing phase from stripping C comments.

-Dname -d[name=def]   Defines name to the preprocessing phase as if defined using the
                      #define directive.  If the definition is not given, name is
                      defined as 1.

          Table 8-2.  (cont.) 

       Option                                   Description 

-E                    Only runs the preprocessing phase on the input file and sends
                      the result to $STDLIST. When you use this option, object file
                      and listing file specifications are ignored.

-g                    Causes the compiler to generate additional information needed by
                      the Symbolic Debugger.  This option is incompatible with
                      optimization.

-Igroup[.acct]        Changes the search algorithm used by the preprocessing phase for
                      finding #include files.  For additional information, see chapter
                      7.

-O                    Invokes the optimizer to perform all optimizations.  This option
                      is not compatible with symbolic debugging.  Refer to the HP C 
                      Programmer's Guide for details on optimization.

-P                    Only runs the preprocessing phase on the source file and stores
                      the result in the file normally used for the object file.  For
                      example, preprocessor output from the command CCXL MYSOURCE,
                      CPPLIST;INFO="-P" is sent to the ASCII file CPPLIST.

-Uname                Removes any initial definition of name in the preprocessing
                      phase.

-v                    Enables the verbose mode, producing a step-by-step description
                      of the compilation process on the listing file.

-w                    Suppresses warning messages.

-Wx,arg1[,arg2,       Hands off the arguments arg1 through argn to the phase x of the
...,argn]             compilation; x can be one of the following values:

--------------------------------------------------------------------------------------------
|                                    |                                                     |
|               Value                |                     Description                     |
|                                    |                                                     |
--------------------------------------------------------------------------------------------
|                                    |                                                     |
|                 p                  |                    Preprocessor                     |
|                                    |                                                     |
--------------------------------------------------------------------------------------------
|                                    |                                                     |
|                 c                  |                      Compiler                       |
|                                    |                                                     |
--------------------------------------------------------------------------------------------

The +arg1 +arg2 notation can be used as a shorthand for the -arg1,-arg2 
notation.

The arguments to the compiler option can be one or more of the following: 

    Argument                                   Description 

     -Csize       Creates the output file for the preprocessing phase with a record
                  length of size.  The default is 512 bytes.[REV BEG]

       -e         Allows the use of extension features, such as long pointers and using
                  the $ character in the identifier name.[REV END]

     -Fsize       Creates the output file for the preprocessing phase with a limit of
                  size.  The default is 7500 records.

       -m         Causes the identifier maps to be printed.  Refer to chapter 11, "The
                  Listing Facility," for listing options and format.

       -o         Causes the code offsets to be printed.  Refer to chapter 11, "The
                  Listing Facility," for listing options and format.    [REV BEG]

     -Obbnum      Specifies the maximum number of basic blocks allowed in a procedure
                  which is to be optimized at level 2.  A basic block is a sequence of
                  code with a single entry point, single exit point, and no internal
                  branches.  Optimizing procedures with a large number of basic blocks
                  can take a long time and use a large amount of memory.  If the limit
                  is exceeded, a warning message lists the name of the procedure and
                  the number of basic blocks it contains, and then level 1 optimization
                  is performed.  The default value for this limit, if this option is
                  not present is 500.  This option implies level 2 optimization
                  (equivalent to -O or +O2).  [REV END]

      -Oopt       Invokes optimizations selected by opt.  If opt is 1, only level 1
                  optimizations are performed.  If opt is 2, all optimizations are
                  performed.  The option +02 is the same as -O.

      -Rnum       Only allows the first num 'register' variables to actually have the
                  'register' class.  Use this option when the register allocator issues
                  an "out of general registers" message.

    Argument                                   Description 

-r                Inhibits the automatic promotion of float to double in evaluating
                  expressions and passing arguments (-r is invalid in ANSI mode).
                  [REV BEG]

-u                Forces the compiler to generate code to access pointers with
                  half-word addressing.  You should only use this option when you
                  cannot guarantee that pointers will always reference word-aligned
                  items.  See "Pointers to Half-Word Aligned Data Items" in chapter 9
                  for more information.[REV END]

-wn               Specifies the level of the warning messages; n can be one of the
                  following values:

---------------------------------------------------------------------------------------------
|                   |                                                                       |
|       Value       |                              Description                              |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| 1                 | All warnings are issued.                                              |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| 2                 | Only warnings indicating that code generation might be affected are   |
|                   | issued; equivalent to the compiler default without any w options.     |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| 3                 | No warnings are issued.                                               |
|                   |                                                                       |
---------------------------------------------------------------------------------------------

The preprocessor phase supports the aforementioned -C, -D, -I, and -U
options, as well as the following:

-Hn                   Changes the internal macro definition table to be n 
                      bytes in size.  The macro symbol table is increased
                      proportionally.  You should specify a value greater
                      than the 128000 byte default.  Use this option when
                      the preprocessing phase issues a "too many defines"
                      or "too much defining" message.

-P                    Processes the input without producing the line
                      control information used by the next pass of the
                      compiler.

-T                    Forces the preprocessor to use only the first eight
                      characters in distinguishing different preprocessor
                      names (included for backward compatibility to other
                      systems).

Examples 

     CCXL MYTEXT;INFO="-Ddebug -Wc,-r -O"

This example compiles MYTEXT with debug defined as 1 (-Ddebug), inhibits
promotion of float expressions to double (-Wc,-r), and enables all
possible optimizations (-O).

     CCXL MYTEXT,CPPOUT;INFO="-P -C -Ddebug"

This example only executes the preprocessing phase on MYTEXT(-P), leaves
the output with the comments intact in CPPOUT (-C), and defines debug as
1 (-Ddebug).

CCOPTS CI Variable 

Options may also be passed to the compiler using the Command Interpreter
variable CCOPTS. The compiler picks up the value of CCOPTS and places its
contents before any arguments in the INFO string.

Example 

       SETVAR CCOPTS "-g"
       CCXL MYFILE;INFO="-v"

is equivalent to:

       CCXL MYFILE;INFO="-g -v"



MPE/iX 5.0 Documentation