HP C/iX Reference Manual (31506-90011)

120 Chapter8
Compiling and Running HP C/iX Programs
Pragmas
Pragmas
You may include the following pragmas within a source file, but you may not use them
within a function. A pragma is valid from the point that it is included to the end of the
source file or until another pragma changes its status.
[#pragma OPTIMIZE {ONOFF }]
Turns all optimizations ON or OFF, depending on which option you use.
[#pragma OPT_LEVEL {12 }]
Sets optimization level to local when you specify OPT_LEVEL 1, or sets optimization level to
global and local when you specify OPT_LEVEL 2.
#pragma NO_SIDE_EFFECTS
functionname
1
,...,functionname
n
States that
functionname
and all the functions that
functionname
calls will not modify
any of a program's local or global variables. This information allows better optimizations to
be performed when optimization level 2 has been specified.
#pragma ALLOCS_NEW_MEMORY
functionname
1
,...,functionname
n
States that the function
functionname
returns a pointer to "new" memory, such as heap
space, that it allocates or a routine that it calls allocates. This information allows better
optimizations to be performed when optimization level 2 has been specified.
#pragma COPYRIGHT
"string"
Places a copyright notice using
string
as the company name into the relocatable object
module or the program file.
#pragma COPYRIGHT_DATE
"string"
Specifies a date string to be used in a copyright notice appearing in an object module.
#pragma VERSIONID
"string"
Specifies a version number to be associated with a particular piece of software. The
string
is placed into the object file produced when the software is compiled.
#pragma PAGE
Causes a page break in the listing and begins a new page.
#pragma LINES
linenum
Sets the number of lines per page to
linenum.
#pragma WIDTH
pagewidth
Sets the width of the page to
pagewidth.
#pragma TITLE
"string"
Makes
string
the title of the listing.
#pragma SUBTITLE
"string"
Makes
string
the subtitle of the listing.