United States |
|
|
||
This qualifier directs the compiler to flag certain Compaq C-specific constructs and Compaq 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. The default is /NOSTANDARD, which is equivalent to /STANDARD= RELAXED_ANSI. If you specify /STANDARD without an option, the default is /STANDARD=(ANSI89,ISOC94). 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. Compaq 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 (ALPHA ONLY)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_CHARBy 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 Compaq C compiler. If your system has a VAX C compiler installed on it, the Compaq 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 Compaq 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 Compaq C compiler, and the /VAXC qualifier is not supported. /[NO]VERSIONDirects 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.
/[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.13).
The default is /WARNINGS=ENABLE=LEVEL3.
If there are errors in your source file when you compile your program, the Compaq C compiler signals these errors and displays diagnostic messages. Reference the message, locate the error, and, if necessary, correct the error. See Appendix D or the online help for a description of all compiler diagnostic messages. You can control the issuance of specific compiler diagnostic messages or groups of messages with the /[NO]WARNINGS command-line qualifier ( Section 1.3.4) and the #pragma message preprocessor directive ( Section 5.4.13). To display a particular compiler diagnostic message online, enter the following command:
To display a list of all message mnemonics, enter the following command:
Diagnostic messages have the following format:
1.4 Linking a Compaq C ProgramAfter you compile a Compaq C source program or module, use the DCL command LINK to combine your object modules into one executable image, which can then be executed by the OpenVMS system. A source program or module cannot run on the OpenVMS system until it is linked. When you execute the LINK command, the linker performs the following functions:
When using the LINK command on development systems, use the /DEBUG qualifier to link your program module. The /DEBUG qualifier appends to the image all the symbol and line number information appended to the object modules plus information on global symbols, and causes the image to run under debugger control when it is executed. The LINK command produces an executable image by default. However, you can also use the LINK command to obtain shareable images and system images. The /SHAREABLE qualifier directs the linker to produce a shareable image; the /SYSTEM qualifier directs the linker to produce a system image. See Section 1.4.2 for a complete description of these and other LINK command qualifiers.
For a complete discussion of the OpenVMS Linker, see the
OpenVMS Linker Utility Manual.
The LINK command has the following format:
If you specify more than one input file, you must separate the input file specifications with a plus sign (+) or a comma (,). By default, the linker creates an output file with the name of the first input file specified and the file type EXE. If you link more than one file, you should specify the file containing the main program first. Then, the name of your output file will have the same name as your main program module. The execution of a program will begin at the function whose identifier is main , or, if there is no function with this identifier, at the first function seen by the VMS linker.
The following command line links the object files MAINPROG.OBJ, SUBPROG1.OBJ, and SUBPROG2.OBJ to produce one executable image called MAINPROG.EXE:
1.4.2 LINK Command QualifiersYou can use the LINK command qualifiers to modify the linker's output, as well as to invoke the debugging and traceback facilities. Linker output consists of an image file and an optional map file. The following list summarizes some of the most commonly used LINK command qualifiers. A brief description of each qualifier follows this list. For a complete list of LINK qualifiers, see the OpenVMS Linker Utility Manual.
1.4.3 Linker Input FilesYou can specify the object modules to be included in an executable image in any of the following ways:
Table 1-26 shows the default input file types for the linker.
1.4.4 Linker Output FilesWhen you enter the LINK command interactively and do not specify any qualifiers, the linker creates only an executable image file. By default, the resulting image file has the same file name as that of the first object module specified with a file type of EXE. In a batch job, the linker creates both an executable image file and storage map file by default. The default file type for map files is MAP. To specify an alternative name for a map file or image file or to specify an alternative output directory or device, you can include a file specification on the /MAP or /EXECUTABLE qualifier. In the following example, the LINK command creates the image file [PROJECT.EXE]UPDATE.EXE and the map file [PROJECT.MAP]UPDATE.MAP:
1.4.5 Linking Against Object Module Libraries and Shareable ImagesLinking against object modules (stored in object module libraries) or against shareable images are ways of allowing your program to access data and routines outside of your compilation units. You can either create the object module libraries and the shareable images or use the ones provided by Compaq. To access data in object modules and shareable images, you can use LINK command qualifiers, OpenVMS logical names, and options files. For more information about object module libraries, see the OpenVMS Linker Utility Manual. The Compaq C Run-Time Library (RTL) for OpenVMS systems also provides two formats for you to choose from: shareable images or object module libraries. Depending on which type of RTL you want to use and on which type of functions you plan on calling from your programs, you need to supply information to the linker that specifies which versions of the functions to access. When you use the Compaq C RTL and its corresponding header files, remember that the Compaq C RTL ships with the OpenVMS operating system and the header files ship with the Compaq C compiler. Since the releases of the compiler and of the operating system are not synchronized, there may be compatibility issues that you need to consider to use the RTL properly. See the Compaq C release notes (by entering HELP CC/DECC RELEASE_NOTES on the DCL command line) for information that may pertain to this issue.
For a description of the various ways to link with the Compaq C RTL,
see the Compaq C Run-Time Library Reference Manual for OpenVMS Systems.
You can make program modules accessible to other users by storing them in an object module library. To link modules contained in an object module library, use the /INCLUDE qualifier and specify the modules you want to link. The following example links the subprogram modules EGGPLANT, TOMATO, BROCCOLI, and ONION with the main program module GARDEN:
An object module library can also contain a symbol table with the names of each global symbol in the library, and the name of the module in which they are defined. You specify the name of the object module library containing symbol definitions with the /LIBRARY qualifier. When you use the /LIBRARY qualifier during a linking operation, the linker searches the specified library for all unresolved references found in the included modules during compilation. The following example uses the library RACQUETS to resolve undefined symbols in BADMINTON, TENNIS, and RACQUETBALL:
You can define an object module library to be your default library by using the DCL command DEFINE LNK$LIBRARY. The linker searches default user libraries for unresolved references after it searches modules and libraries specified in the LINK command. For more information about the DEFINE command, see the OpenVMS DCL Dictionary. For more information about object module libraries, see the OpenVMS Linker Utility Manual.
| |
privacy statement and legal notices |