HP C/aC++ for PA-RISC Software manual Options to Control Code Generation, ACC -c sub.C prog.C

Models: C/aC++ for PA-RISC Software

1 230
Download 230 pages 50.97 Kb
Page 32
Image 32

Options to Control Code Generation

The following options allow you to control the kind of code that the compiler generates:

-c

+DOosname

+DDdata_model

+DSmodel

-S

-c

You can use the -coption to compile one or more source files without entering the linking phase.

When compiled, the compiler produces an object file (a file ending with .o) for each source file (a file ending with .c, .C, .s, or .i). Note that you must link object files before they can be executed.

Example:

aCC -c sub.C prog.C

In this example, the compiler compiles sub.C and prog.C and puts the relocatable object code in the files, sub.o and prog.o, respectively.

+DOosname

The +DOosname option sets the target operating system for the compiler, and is intended for enabling optimizations that are not backward compatible.

For instance, the 11.23 compiler introduces new optimized math library functions that require library support not available in prior operating systems. +DO can be used at any level of optimization. The default value for osname is the operating system version on which the compiler is invoked.

The syntax for this option is +DOosname, where osname is either 11.20, 11.22 or 11.23.

Example:

The following example generates code for the HP-UX 11.22 (or later) operating system. Binary incompatible features introduced in later OS versions are inhibited.

aCC +DO11.22 +O3 app.C

+DDdata_model

The +DDdata_model option specifies the data model for the compiler.

data_model can be one of the following:

32 (This value generates ILP32 code and is the default.)

64 (This value generates LP64 code.)

This option specifies the data model for the compiler. Table 2 lists the differences between the two data models.

Table 2 ILP32 Data Model and LP64 Data Model

ILP32 Data Model

The size of an int, long, or pointer data type is 32-bits.

The preprocessor predefined macro _ILP32 is defined.

LP64 Data Model

The size of an int data type is 32-bits. The size of a long or pointer data type is 64-bits.

The preprocessor predefined macros__LP64__ and _LP64 are defined.

32 Command-Line Options

Page 32
Image 32
HP C/aC++ for PA-RISC Software manual Options to Control Code Generation, ACC -c sub.C prog.C, ACC +DO11.22 +O3 app.C