Intel XENIX 286 Programmers Guide (86) - Tenox.tc
Intel XENIX 286 Programmers Guide (86) - Tenox.tc Intel XENIX 286 Programmers Guide (86) - Tenox.tc
XENIX Programming cc: C Compiler Using Modules, Segments, and Groups "Module" is another name for an object file created by the C compiler. Every module has a name, and the cc command uses this name in error messages if problems are encountered during linking. The module name is usually the same as the source file's name (without the ".c" or ".s" extension). You can change this name using the -NM option. The option has the form -NM name where name can be any combination of letters and digits. Changing a module's name is useful if the source file to be compiled is actually the output of a program preprocessor and generator, such as lex or yacc. A "segment" is a contiguous block of binary code produced by the C compiler. Every module has two segments: a text segment containing the program instructions, and a data segment containing the program data. Each segment in every module has a name. This name is used by cc to define the order in which the segments of the program will appear in memory when loaded for execution. Text segments having the same name are loaded as a contiguous block of code. Data segments of the same name are also loaded as contiguous blocks. Text and data segment names are normally created by the C compiler. These default names depend on the memory model chosen for the program. For example, in small model programs the text segment is named " TEXT" and the data segment is named "_DATA". These names are the same for all small model modules, so all segments from all modules of a small model program are loaded as a contiguous block. In middle model programs, each text segment has a different name. In large and huge model programs, each text and data segment has a different name. The default text and data segment names for middle, large, and huge model programs are given in the section "Segment and Module Names" at the end of this chapter. You can override the default names used by the C compiler (and override the default loading order) by using the -NT and -ND options. These options set the names of the text and data segments, in each module being compiled, to a given name. The options have the form and -NT name -ND name where name is any combination of letters and digits. These options are useful in middle, large, and huge model programs where there is no specific loading order. In these programs, you can guarantee contiguous loading for two or more segments by giving them the same name. Note: Modules compiled with -ND option cannot call any system libraries. 2-19
cc: C Compiler XENIX Programming Compiler Summary The following sections summarize cc options and memory models. -P Preprocesses each source file and copies the result to a file whose basename is the same as the source but whose extension is .i. Preprocessing performs the actions specified by the preprocessing directives in the source file, and inhibits compilation and linking. -E Preprocesses each source file as described for -P, but copies the result to the standard output. The option also places a #line directive with the current input line number and source filename at the beginning of output for each file. -EP Preprocesses each source file as described for -E, but does not place a #line directive at the beginning of the file. -C Preserves comments when preprocessing a file with -E or -P. That is, comments are not removed from the preprocessed source. This option may be used only in conjunction with -E or -P. -D name [=string] Defines name to the preprocessor as if defined by a #define in each source file. The form -D name sets name to 1. The form -D name = string sets name to the given string. -U name [=string] Removes definition of name so that the preprocessor removes the name defined by a #define in each source file. The form -U name sets name to 0. The form -U name = string undefines name for the given string. -I pathname Adds pathname to the list of directories to be searched when a #include file is not found in the directory containing the current source file or whenever angle brackets ( < >) enclose the filename. There is a standard list of directories which is searched automatically. -X Removes the standard directories from the list of directories to be searched for #include files. -v string Copies string to the object file created from the given source file. This option may be used for version control. -W num Sets the output level for compiler warning messages. If num is 0, no warning messages are issued. If 1, only warnings about program structure and overt type mismatches are issued. If 2, warnings about strong typing mismatches are issued. If 3, warnings for all automatic conversions are issued. This option does not affect compiler message output for non-warning messages. -w Prevents compiler warning messages from being issued. Same as -W 0. -p Adds code for program profiling. Profiling code counts the nu mber of calls to 2-20
- Page 1 and 2: 0 • • •
- Page 3 and 4: The information in this document is
- Page 5 and 6: Table of Contents CONTENTS Compiler
- Page 7 and 8: Table of Contents CONTENTS Using Ot
- Page 9 and 10: Table of Contents CONTENTS Assemble
- Page 11 and 12: Table of Contents CONTENTS CHAPTER
- Page 13 and 14: Table of Contents TABLES TABLE TITL
- Page 15 and 16: Introduction XENIX Programming 10.
- Page 17 and 18: cc: C Compiler XENIX Programming Cr
- Page 19 and 20: cc: C Compiler XENIX Programming Th
- Page 21 and 22: cc: C Compiler XENIX Programming Th
- Page 23 and 24: cc: C Compiler XENIX Programming Cr
- Page 25 and 26: cc: C Compiler XENIX Programming Th
- Page 27 and 28: cc: C Compiler XENIX Programming Co
- Page 29 and 30: cc: C Compiler XENIX Programming Sa
- Page 31 and 32: cc: C Compiler XENIX Programming Us
- Page 33: cc: C Compiler XENIX Programming Wh
- Page 37 and 38: cc: C Compiler XENIX Programming d
- Page 39 and 40: cc: C Compiler XENIX Programming Se
- Page 41 and 42: lint: C Program Checker XENIX Progr
- Page 43 and 44: lint: C Program Checker XENIX Progr
- Page 45 and 46: lint: C Program Checker XENIX Progr
- Page 47 and 48: lint: C Program Checker XENIX Progr
- Page 49 and 50: lint: C Program Checker XENIX Progr
- Page 51 and 52: lint: C Program Checker XENIX Progr
- Page 53 and 54: make: Program Maintainer XENIX Prog
- Page 55 and 56: make: Program Maintainer XENIX Prog
- Page 57 and 58: make: Program Maintainer XENIX Prog
- Page 59 and 60: make: Program Maintainer XENIX Prog
- Page 61 and 62: make: Program Maintainer XENIX Prog
- Page 63 and 64: make: Program Maintainer XENIX Prog
- Page 65 and 66: make: Program Maintainer print: $(F
- Page 67 and 68: SCCS: Source Code Control System XE
- Page 69 and 70: SCCS: Source Code Control System XE
- Page 71 and 72: SCCS: Source Code Control System XE
- Page 73 and 74: SCCS: Source Code Control System XE
- Page 75 and 76: SCCS: Source Code Control System XE
- Page 77 and 78: SCCS: Source Code Control System XE
- Page 79 and 80: SCCS: Source Code Control System XE
- Page 81 and 82: SCCS: Source Code Control System XE
- Page 83 and 84: SCCS: Source Code Control System XE
cc: C Compiler <strong>XENIX</strong> Programming<br />
Compiler Summary<br />
The following sections summarize cc options and memory models.<br />
-P Preprocesses each source file and copies the result to a file whose basename is<br />
the same as the source but whose extension is .i. Preprocessing performs the<br />
actions specified by the preprocessing directives in the source file, and inhibits<br />
compilation and linking.<br />
-E Preprocesses each source file as described for -P, but copies the result to the<br />
standard output. The option also places a #line directive with the current input<br />
line number and source filename at the beginning of output for each file.<br />
-EP Preprocesses each source file as described for -E, but does not place a #line<br />
directive at the beginning of the file.<br />
-C Preserves comments when preprocessing a file with -E or -P. That is, comments<br />
are not removed from the preprocessed source. This option may be used only in<br />
conjunction with -E or -P.<br />
-D name [=string]<br />
Defines name to the preprocessor as if defined by a #define in each source file.<br />
The form -D name sets name to 1. The form -D name = string sets name to the<br />
given string.<br />
-U name [=string]<br />
Removes definition of name so that the preprocessor removes the name defined<br />
by a #define in each source file. The form -U name sets name to 0. The form<br />
-U name = string undefines name for the given string.<br />
-I pathname<br />
Adds pathname to the list of directories to be searched when a #include file is<br />
not found in the directory containing the current source file or whenever angle<br />
brackets ( < >) enclose the filename. There is a standard list of directories which<br />
is searched automatically.<br />
-X Removes the standard directories from the list of directories to be searched for<br />
#include files.<br />
-v string<br />
Copies string to the object file created from the given source file. This option<br />
may be used for version control.<br />
-W num<br />
Sets the output level for compiler warning messages. If num is 0, no warning<br />
messages are issued. If 1, only warnings about program structure and overt type<br />
misma<strong>tc</strong>hes are issued. If 2, warnings about strong typing misma<strong>tc</strong>hes are issued.<br />
If 3, warnings for all automatic conversions are issued. This option does not<br />
affect compiler message output for non-warning messages.<br />
-w Prevents compiler warning messages from being issued. Same as -W 0.<br />
-p Adds code for program profiling. Profiling code counts the nu mber of calls to<br />
2-20