|
HP C
HP C User's Guide for OpenVMS Systems
Your code may execute faster if it contains
float
variables and is compiled with /PRECISION=SINGLE. However, the results
of your floating-point operations will be less precise. See the
HP C Language Reference Manual for more information on floating-point variables.
The default is /PRECISION=DOUBLE for /STANDARD=VAXC and
/STANDARD=COMMON compiler modes.
The default is /PRECISION=SINGLE for /STANDARD=ANSI89 and
/STANDARD=RELAXED compiler modes.
/[NO]PREFIX_LIBRARY_ENTRIES[=(option[,...])]
The HP C Run-Time Library (RTL) shareable image, DECC$SHR.EXE,
resides in SYS$LIBRARY with a DECC$ prefix for its entry points. The
linker searches IMAGELIB.OLB to locate the shareable image. Every
external name in IMAGELIB.OLB has a DECC$ prefix, and, therefore, has
an OpenVMS conformant name space (a requirement for inclusion in
IMAGELIB).
The /[NO]PREFIX_LIBRARY_ENTRIES qualifier lets you control the
HP C RTL name prefixing. Table 1-20 describes the
/PREFIX_LIBRARY_ENTRIES qualifier options.
Table 1-20 /PREFIX_LIBRARY_ENTRIES Qualifier Options
Option |
Usage |
EXCEPT = (
name,...)
|
The names specified are not prefixed.
|
ALL_ENTRIES
|
All HP C RTL names, as well as C99 names not supported by the
underlying C RTL, are prefixed.
|
ANSI_C89_ENTRIES
|
Only C Standard 89 (C89) library names are prefixed.
|
C99_ENTRIES
|
Only C Standard 99 (C99) library names are prefixed. These are a
superset of the external names prefixed under /PREFIX=ANSI_C89_ENTRIES
and a subset of those prefixed under /PREFIX=ALL_ENTRIES.
The compiler will prefix C99 entries based on their inclusion in the
standard, not on the availability of their implementations in the
run-time library. So calling functions introduced in C99 that are not
yet implemented in the HP C RTL will produce unresolved references to
symbols prefixed by DECC$ when the program is linked. In addition, the
compiler will issue a CC-W-NOTINCRTL message when it prefixes a name
that is not in the current C RTL.
|
RTL="
name"
|
Generates references to the C RTL indicated by the
name keyword. (The
name keyword has a length limit of 24 characters for OpenVMS
VAX systems and 1017 characters for OpenVMS Alpha systems.) If no
keyword is specified, then references to the HP C RTL are
generated by default. To use an alternate RTL, see its documentation
for the name to use.
|
If you want no names prefixed, specify /NOPREFIX_LIBRARY_ENTRIES.
For /STANDARD=ANSI89, the default is /PREFIX=ANSI_C89_ENTRIES.
For /STANDARD=C99, the default is /PREFIX=C99_ENTRIES.
For all other compiler modes, the default is /PREFIX=ALL.
/[NO]PREPROCESS_ONLY[=filename]
Gives the same functionality as the
-E
qualifier on UNIX C compilers. When specified, it performs only the
actions of the preprocessor phase and writes the resulting processed
text to a file. No semantic or syntax processing is done. Furthermore,
no object file or analysis file can be produced.
If you do not specify a file name for the preprocessor output, the name
of the output file defaults to the file name of the input file with a
.I file type.
The default is /NOPREPROCESS_ONLY.
/[NO]PROTOTYPE[=(option[,...])]
Creates an output file containing function prototypes for all global
functions defined in the module being compiled.
Standard-style prototypes are created even for functions defined with
Kernighan and Ritchie style syntax.
This qualifier can be used to convert to Standard-sytle prototypes or
just to ensure that every function definition has a compatible explicit
declaration, thereby avoiding implicit declarations that can sometimes
produce surprising results.
Table 1-21 describes the /PROTOTYPE qualifier options.
Table 1-21 /PROTOTYPE Qualifier Options
Option |
Usage |
[NO]IDENTIFIERS
|
Indicates that identifier names are to be included in the prototype
declarations that appear in the output file. The default is
NOIDENTIFIERS.
|
[NO]STATIC_FUNCTIONS
|
Indicates that prototypes for static function definitions are to be
included in the output file. The default is NOSTATIC_FUNCTIONS.
|
FILE=
filename
|
Specifies the output file name. When not specified, the output file
name has the same defaults as the listing file, except that the file
extension is .CH instead of .LIS.
|
The default is /NOPROTOTYPES.
/PSECT_MODEL=[NO]MULTILANGUAGE
Controls whether the compiler allocates the size of overlaid psects to
ensure compatibility when the psect is shared by code created by other
HP compilers.
The problem this switch solves can occur when a psect generated by a
FORTRAN COMMON block is overlaid with a psect consisting of a C struct.
Because FORTRAN COMMON blocks are not padded, if the C struct is
padded, the inconsistent psect sizes can cause linker error messages.
Compiling with /PSECT_MODEL=MULTILANGUAGE ensures that HP C
uses a consistent psect size allocation scheme. The corresponding
FORTRAN switch is /ALIGN=COMMON=[NO]MULTILANGUAGE.
The default is /PSECT=NOMULTILANGUAGE, which is the old default
behavior of the compiler, and is sufficient for most applications.
/REENTRANCY=option
Controls the type of reentrancy that reentrant HP C RTL
routines will exhibit. (See the
decc$set_reentrancy
RTL routine.)
This qualifier is for use only with a module containing the
main
routine.
The reentrancy level is set at runtime according to the /REENTRANCY
qualifier specified while compiling the module containing the
main
routine.
Table 1-22 describes the /REENTRANCY qualifier options.
Table 1-22 /REENTRANCY Qualifier Options
Option |
Usage |
AST
|
Uses the __TESTBITSSI built-in function to perform simple locking
around critical sections of RTL code, and may additionally disable
asynchronous system traps (ASTs) in locked region of codes. This type
of locking should be used when AST code contains calls to HP C
RTL I/O routines.
|
MULTITHREAD
|
Designed to be used in conjunction with the DECthreads product. It
performs DECthreads locking and never disables ASTs.
|
NONE
|
Gives optimal performance in the RTL, but does absolutely no locking
around critical sections of RTL code. It should only be used in a
single threaded environment when there is no chance that the thread of
execution will be interrupted by an AST that would call the
HP C RTL.
|
TOLERANT
|
Uses the __TESTBITSSI built-in function to perform simple locking
around critical sections of RTL code, but ASTs are not disabled. This
type of locking should be used when ASTs are used and must be delivered
immediately.
|
The default is /REENTRANCY=TOLERANT.
/REPOSITORY=option
Specifies a repository for the compiler to store shortened external
name information. When /NAMES=SHORTENED is specified, the compiler
stores to the repository any external names that were shortened. The
demangler utility can then be used to map the shortened names back to
the names used in the original C program.
By default, the qualifier is not active unless /NAMES=SHORTENED has
been specified, in which case the default is
/REPOSITORY=[.CXX_REPOSITORY].
The default name of the repository is the same as that used by the HP
C++ compiler for decoding mangled names. This is intentional. A C++
mangled name cannot match a shortened name, so a single repository can
be used by both the HP C and HP C++ compilers.
/ROUNDING_MODE=option
If /FLOAT=IEEE_MODE is specified, the /ROUNDING_MODE qualifier lets you
select one of the following IEEE rounding modes:
Option |
Usage |
NEAREST
|
Sets the normal rounding mode (unbiased round to nearest). This is the
default.
|
DYNAMIC
|
Sets the rounding mode for IEEE floating-point instructions
dynamically, as determined from the contents of the floating-point
control register.
|
MINUS_INFINITY
|
Rounds toward minus infinity.
|
CHOPPED
|
Rounds toward 0.
|
If /FLOAT=G_FLOAT or /FLOAT=D_FLOAT is specified, then rounding
defaults to /ROUNDING_MODE=NEAREST, with no other choice of rounding
mode.
/[NO]SHARE_GLOBALS
Controls whether the compiler will treat declarations of objects with
the
globaldef
keyword as shared or not shared.
Also, in conjunction with the /EXTERN_MODEL qualifier, controls whether
the initial
extern_model
is shared or not shared (for those
extern_model
s where it is allowed). The initial
extern_model
of the compiler is a fictitious pragma constructed from the settings of
the /EXTERN_MODEL and /SHARE_GLOBALS qualifiers.
The default value is /NOSHARE_GLOBALS. This default value is different
from VAX C, which treats external objects as shared by default. As a
result, you may experience the following impact:
- Linking old object files or object libraries with newly produced
object files might generate "conflicting attributes for
psect" messages. As long as you are not building shareable
libraries, you can safely ignore these messages.
- Building shareable libraries will be easier.
- On OpenVMS VAX systems, when linking external symbols against
FORTRAN common blocks, you should specify /SHARE_GLOBALS to suppress
"conflicting attributes for psect" messages; although they
can otherwise be ignored. (VAX ONLY)
/SHOW[=(option[,...])]
Sets or cancels listing options. You must use the /LIST qualifier with
the /SHOW qualifier to use any of the /SHOW options. Table 1-23
describes the /SHOW qualifier options.
Table 1-23 /SHOW Qualifier Options
Option |
Usage |
ALL
|
Prints all listing information.
|
[NO]BRIEF
|
Creates the same listing as the option SYMBOLS except that BRIEF
eliminates from the list any identifiers that are not referenced in the
program, and are not members of a structure or union that is referenced
in the program.
The NOBRIEF option is the default.
|
[NO]CROSS_REFERENCE
|
Specifies whether the compiler generates cross-references. If you
specify /SHOW=CROSS_REFERENCE, the compiler lists, for each variable
referenced in the procedure, the line numbers of the lines on which the
variable is referenced.
You may use /SHOW=CROSS_REFERENCE with /SHOW=SYMBOLS. Otherwise,
specifying /SHOW=CROSS_REFERENCE also gives you /SHOW=BRIEF. To obtain
any type of listing, you must specify /LIST. Specifying
/SHOW=[NO]CROSS_REFERENCE is the same as specifying
/[NO]CROSS_REFERENCE.
The NOCROSS_REFERENCE option is the default.
|
[NO]DICTIONARY
|
Places CDD/Repository definitions---included in the program with the
#pragma dictionary
preprocessor directive---into the listing file. These data definitions
are marked in the listing file with an uppercase letter D in the
listing margin.
The NODICTIONARY option is the default.
|
[NO]EXPANSION
|
Places final macro expansions in the program listing. However,
expansion text for preprocessing directives is not shown. When you
specify this option, the number printed in the margin indicates the
maximum depth of macro substitutions that occur on each line.
The NOEXPANSION option is the default.
|
[NO]HEADER
|
Produces the header lines at the top of each page of a listing.
The HEADER option is the default.
|
[NO]INCLUDE
|
Places the contents of
#include
files and modules in the program listing.
The NOINCLUDE option is the default.
|
[NO]INTERMEDIATE (VAX ONLY)
|
Places all intermediate and final macro expansions in the program
listing.
The NOINTERMEDIATE option is the default.
|
[NO]MESSAGES
|
Lists all messages that are in effect at compilation (based on the
settings of /STANDARD, /WARNINGS, and #pragma message).
The NOMESSAGE option is the default.
|
NONE
|
Creates an empty listing file with only the header. If you specify this
option on a CC command line that contains /LIST and /MACHINE_CODE, the
compiler places machine code in the listing file.
|
[NO]SOURCE
|
Places the source program statements in the program listing.
The SOURCE option is the default.
|
[NO]STATISTICS
|
Places compiler performance statistics in the program listing.
The NOSTATISTICS option is the default.
|
[NO]SYMBOLS
|
Places the symbol table of the compiled program in the program listing.
The symbol table includes a list of all functions, the sizes and
attributes of all variables referenced in the program, and a program
section summary and function definition map.
The NOSYMBOLS option is the default.
|
[NO]TERMINAL (VAX ONLY)
|
Displays compiler messages to the terminal. Use /SHOW=NOTERMINAL to
suppress compiler messages to the terminal or to a batch log file.
The TERMINAL option is the default.
|
[NO]TRANSLATION (VAX ONLY)
|
Places into the listing file all UNIX system file specifications that
the compiler translates to OpenVMS file specifications. See the
HP C Run-Time Library Reference Manual for OpenVMS Systems for more information on file translation.
The NOTRANSLATION option is the default.
|
/[NO]STANDARD[=(option[,...])]
Defines the compilation mode, directing the compiler to flag certain
HP C-specific constructs and HP C relaxations of
conventional C language constructs and rules. For example, the
conversions from pointer to integer and back again are subject to more
stringent tests when you specify /STANDARD=ANSI89.
Table 1-24 describes the /STANDARD qualifier options.
Table 1-24 /STANDARD Qualifier Options
Option |
Usage |
ANSI89
|
Places the compiler in strict C Standard mode.
|
C99
|
Places the compiler in strict ISO/IEC C99 Standard mode. Note that
/STANDARD=C99 is not fully supported on VAX systems. Specifying
/STANDARD=C99 on OpenVMS VAX systems produces a warning and puts the
compiler into /STANDARD=RELAXED mode.
|
LATEST
|
Places the compiler in the latest ISO C standard dialect.
/STANDARD=LATEST is currently equivalent to /STANDARD=C99, but is
subject to change when newer versions of the ISO C standard are
released.
|
RELAXED
|
Places the compiler in relaxed C Standard mode.
|
MS
|
Interprets source programs according to certain language rules followed
by Microsoft's Visual C++ compiler.
|
ISOC94
|
Places the compiler in ISO C 94 mode, which enables digraph processing
and defines the macro
__STDC_VERSION__=199409L
.
Digraphs are pairs of characters that translate into a single
character, much like trigraphs, except that trigraphs get replaced
inside string literals, but digraphs do not. The digraphs are:
Digraph |
Character Represented |
<:
|
[
|
:>
|
]
|
<%
|
{
|
%>
|
}
|
%:
|
#
|
%:%:
|
##
|
The ISOC94 option can be specified alone or in combination with any other option except VAXC. If specified alone, ISOC94 provides a default major mode of RELAXED.
|
COMMON
|
Places the compiler in common C mode. This mode enforces K & R
programming style; that is, compatibility with older UNIX compilers
such as
pcc
and
gcc
.
|
VAXC
|
Places the compiler in VAX C mode.
|
PORTABLE
|
Places the compiler in RELAXED mode, and enables the issuance of
diagnostics that warn about any nonportable usages encountered.
/STANDARD=PORTABLE is supported for VAX C compatibility only. It is
equivalent to the recommended combination of qualifiers /STANDARD=
RELAXED/WARNINGS=ENABLE=PORTABLE.
|
MIA
|
Places the compiler in strict C Standard mode with some behavior
differences, as required by the MIA standard:
Compiling a program with /STANDARD=MIA sets the
__MIA
predefined macro to 1.
|
The default is /NOSTANDARD, which is equivalent to /STANDARD=RELAXED.
If you specify /STANDARD, you must supply at least one option.
With one exception, the /STANDARD qualifier options are mutually
exclusive. Do not combine them. The exception is that you can specify
/STANDARD=ISOC94 with any other option except VAXC.
HP C modules compiled in different modes can be linked and
executed together.
Also see the
__HIDE_FORBIDDEN_NAMES
predefined macro ( Section 6.1.7).
/[NO]TIE
Enables the compiled code to be used in combination with translated
images, either because the code might call into a translated image or
might be called from a translated image. The default is /NOTIE.
/[NO]UNDEFINE=(identifier[,...])
See /[NO]DEFINE in this section.
/[NO]UNSIGNED_CHAR
By default,
char
is a signed character type. The /UNSIGNED_CHAR qualifier lets you
change this default to an unsigned character type, which causes all
plain
char
declarations to have the same representation and set of values as
unsigned char
declarations. The default is /NOUNSIGNED_CHAR.
/VAXC (VAX ONLY)
Invokes the VAX C compiler.
The CC command is used to invoke either the VAX C or HP C
compiler. If your system has a VAX C compiler installed on it, the
HP C installation procedure provides the option of specifying
which compiler will be invoked by default when just the CC command is
used. To invoke the compiler that is not the default, use the CC
command with the appropriate qualifier: CC/DECC for the HP C
compiler, or CC/VAXC for the VAX C compiler.
If your system does not have a VAX C compiler installed on it, the CC
command will invoke the HP C compiler, and the /VAXC qualifier
is not supported.
/[NO]VERSION
Directs the compiler to print out the compiler version and platform.
The compiler version is the same as in the listing file.
This qualifier makes it easier for you to report what compiler you are
using.
Note
To display the compiler version and platform when issuing the CC
command for a source file that does not exist, enter:
|
/[NO]WARNINGS[=(option[,...])]
Controls the issuance of compiler diagnostic messages or groups of
messages. It also allows for the severity of messages to be modified.
The default qualifier, /WARNINGS, enables all warning and informational
messages for the compiler mode you are using. The /NOWARNINGS qualifier
suppresses the warning and informational messages. Also see the
#pragma message
preprocessor directive.
Table 1-25 describes the /WARNING qualifier options.
For a description of what to specify for the message-list, see
the
#pragma message
preprocessor directive ( Section 5.4.14).
Table 1-25 /WARNINGS Qualifier Options
Option |
Usage |
DISABLE=
message-list
|
Suppresses the issuance of the specified messages.
Only messages of severity Warning (W) or Information (I) can be
disabled. If the message has severity of Error (E) or Fatal (F), it is
issued regardless of any attempt to disable it.
|
ENABLE=
message-list
|
Enables issuance of the specified messages.
|
NOINFORMATIONALS
|
Suppresses informational messages.
|
EMIT_ONCE=
message-list
|
Emits the specified messages only once per compilation.
Certain messages are emitted only the first time the compiler
encounters the causal condition. When the compiler encounters the same
condition later in the program, no message is emitted. Messages about
the use of language extensions are an example of this kind of message.
To emit one of these messages every time the causal condition is
encountered, use the EMIT_ALWAYS option.
Errors and Fatals are always emitted. You cannot set them to
EMIT_ONCE.
|
EMIT_ALWAYS=
message-list
|
Emits the specified messages at every occurrence of the causal
condition.
|
ERRORS=
message-list
|
Sets the severity of the specified messages to Error.
Supplied Error messages and Fatal messages cannot be made less
severe. (Exception: A message can be upgraded from Error to Fatal, then
later downgraded to Error again, but it can never be downgraded from
Error.)
Warnings and Informationals can be made any severity.
|
FATALS=
message-list
|
Sets the severity of the specified messages to Fatal.
|
INFORMATIONALS=
message-list
|
Sets the severity of the specified messages to Informational. Note that
Fatal and Error messages cannot be made less severe.
|
WARNINGS=
message-list
|
Sets the severity of the specified messages to Warning. Note that Fatal
and Error messages cannot be made less severe.
|
VERBOSE
|
Displays the full message information for every compiler message
encountered. This information includes the message description and user
action, as well as the identifier, severity, and message text.
When /WARNINGS=VERBOSE is used with /LIST/SHOW=MESSAGES, a list of
all messages in effect at compilation are added to the listing file,
showing the full information for each message.
|
Notes
- If a message is on both the enabled and disabled list, it is
disabled.
- If a message is on both the EMIT_ONCE and the EMIT_ALWAYS list, it
is considered to be on the EMIT_ONCE list.
- If a message is on more than one of the FATALS, ERRORS, WARNINGS,
or INFORMATIONALS lists, the message is given the least severe level.
- The NOINFORMATIONALS option is not the negation of
INFORMATIONALS=msg-list. It is valid to specify:
/WARNINGS=(INFORMATIONALS=message_list,NOINFORMATIONALS)
|
This has the effect of making the messages on the message_list
informationals, and causing the compiler to suppress any informational
messages.
- One of the message groups described in the
#pragma message
description in Section 5.4.14 is UNUSED, which enables messages that
report apparently unnecessary
#include
files and CDD records.
However, unlike any other messages, these messages must be enabled on
the command line (/WARNINGS=ENABLE=UNUSED) to be effective. Any
#pragma message
directives within the source have no effect on these messages; their
state is determined only by processing the command line.
|
|