Difference between revisions of "C Compiler"
(Created page with "The '''C Compiler''' is the software that compiles code written in C into object files. =Includes= CC /INCLUDE_DIRECTORY qualifier provides similar functionality to the -I o...") |
|||
Line 12: | Line 12: | ||
/INCLUDE="" | /INCLUDE="" | ||
− | + | The interpretation depends on the format of the #include directive: whether it is is quotes or angle brackets: | |
− | |||
− | |||
− | |||
− | |||
− | |||
#include "stdio.h" | #include "stdio.h" | ||
− | |||
− | |||
#include <stdio.h> | #include <stdio.h> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
==Quoted includes== | ==Quoted includes== | ||
+ | 1. Look at the /NESTED qualifier on the CC command. | ||
+ | * missing or /NESTED=INCLUDE: search the directory containing the source file with the #include directive | ||
+ | * /NESTED=PRIMARY: search the default file type for headers using the context of the primary source files | ||
+ | * /NESTED=NONE: do nothing | ||
− | + | 2. Search for the places specificed in the /INCLUDE directive. If it does not include the file types, look for .H files. | |
− | |||
− | |||
− | |||
− | |||
− | + | 3. Is DECC$USER_INCLUDE defined? | |
− | + | If so: | |
+ | if /ASSUME=NOHEAD on the CC command, search DECC$USER_INCLUDE for any file types | ||
+ | if /ASSUME=HEAD (or missing), search DECC$USER_INCLUDE for .H files | ||
+ | If not, so nothing | ||
− | + | 4. If still not found, assume angle brackets and try the instructions below. | |
− | |||
− | 4. | ||
==Angle bracketed includes== | ==Angle bracketed includes== | ||
− | 1. | + | 1. Search the / location |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | 2. Search for the places specificed in the /INCLUDE directive. If it does not include the file types, look for .H files. | |
− | |||
− | + | 3. Is DECC$USER_INCLUDE defined? | |
+ | If so: | ||
+ | if /ASSUME=NOHEAD on the CC command, search DECC$USER_INCLUDE for any file types | ||
+ | if /ASSUME=HEAD (or missing), search DECC$USER_INCLUDE for .H files | ||
+ | If not, so nothing. | ||
− | + | 4. Look at the definitions of DECC$LIBRARY_INCLUDE and DECC$SYSTEM_INCLUDE logicals. | |
+ | * both defined or only DECC$SYSTEM_INCLUDE is defined: search "DECC$SYSTEM_INCLUDE:.H", or just "DECC$SYSTEM_INCLUDE:." if /ASSUME=NOHEADER_TYPE_DEFAULT is in effect. | ||
+ | * only DECC$LIBRARY_INCLUDE is defined: search "DECC$LIBRARY_INCLUDE:.H", or just "DECC$LIBRARY_INCLUDE:." if /ASSUME=NOHEADER_TYPE_DEFAULT is in effect. | ||
+ | * neither is defined: search | ||
+ | SYS$COMMON:[DECC$LIB.INCLUDE.DECC$RTLDEF]*.H | ||
+ | SYS$COMMON:[DECC$LIB.INCLUDE.SYS$STARLET_C]*.H | ||
− | + | 5. Seacrch the libraries included with the /LIBRARY qualifier for modules with the same name. If /INCLUDE contained an empty string, stop there - otherwise also search DECC$TEXT_LIBRARY. | |
+ | If DECC$LIBRARY_INCLUDE is defined, do not search further. Otherwise search SYS$LIBRARY:DECC$RTLDEF.TLB and SYS$LIBRARY:SYS$STARLET_C.TLB for .H and . files and SYS$LIBRARY:SYS$STARLET_C.TLB for any files other than .H and . | ||
− | + | 6. Search SYS$LIBRARY:.H or . if /ASSUME=NOHEADER_TYPE_DEFAULT. | |
− | |||
− |
Revision as of 11:52, 19 September 2023
The C Compiler is the software that compiles code written in C into object files.
Includes
CC /INCLUDE_DIRECTORY qualifier provides similar functionality to the -I option of the cc command on DIGITAL UNIX systems: it allows you to specify additional places to search for include files. It can be one of the following:
- OpenVMS file-spec to be used as a default file-spec to RMS file services:
/INCLUDE=DISK$:[directory]
- UNIX style pathname in quotation marks
/INCLUDE=/sys
- Empty string ("")
/INCLUDE=""
The interpretation depends on the format of the #include directive: whether it is is quotes or angle brackets:
#include "stdio.h" #include <stdio.h>
Quoted includes
1. Look at the /NESTED qualifier on the CC command.
- missing or /NESTED=INCLUDE: search the directory containing the source file with the #include directive
- /NESTED=PRIMARY: search the default file type for headers using the context of the primary source files
- /NESTED=NONE: do nothing
2. Search for the places specificed in the /INCLUDE directive. If it does not include the file types, look for .H files.
3. Is DECC$USER_INCLUDE defined?
If so: if /ASSUME=NOHEAD on the CC command, search DECC$USER_INCLUDE for any file types if /ASSUME=HEAD (or missing), search DECC$USER_INCLUDE for .H files If not, so nothing
4. If still not found, assume angle brackets and try the instructions below.
Angle bracketed includes
1. Search the / location
2. Search for the places specificed in the /INCLUDE directive. If it does not include the file types, look for .H files.
3. Is DECC$USER_INCLUDE defined? If so: if /ASSUME=NOHEAD on the CC command, search DECC$USER_INCLUDE for any file types if /ASSUME=HEAD (or missing), search DECC$USER_INCLUDE for .H files If not, so nothing.
4. Look at the definitions of DECC$LIBRARY_INCLUDE and DECC$SYSTEM_INCLUDE logicals.
- both defined or only DECC$SYSTEM_INCLUDE is defined: search "DECC$SYSTEM_INCLUDE:.H", or just "DECC$SYSTEM_INCLUDE:." if /ASSUME=NOHEADER_TYPE_DEFAULT is in effect.
- only DECC$LIBRARY_INCLUDE is defined: search "DECC$LIBRARY_INCLUDE:.H", or just "DECC$LIBRARY_INCLUDE:." if /ASSUME=NOHEADER_TYPE_DEFAULT is in effect.
- neither is defined: search
SYS$COMMON:[DECC$LIB.INCLUDE.DECC$RTLDEF]*.H SYS$COMMON:[DECC$LIB.INCLUDE.SYS$STARLET_C]*.H
5. Seacrch the libraries included with the /LIBRARY qualifier for modules with the same name. If /INCLUDE contained an empty string, stop there - otherwise also search DECC$TEXT_LIBRARY. If DECC$LIBRARY_INCLUDE is defined, do not search further. Otherwise search SYS$LIBRARY:DECC$RTLDEF.TLB and SYS$LIBRARY:SYS$STARLET_C.TLB for .H and . files and SYS$LIBRARY:SYS$STARLET_C.TLB for any files other than .H and .
6. Search SYS$LIBRARY:.H or . if /ASSUME=NOHEADER_TYPE_DEFAULT.