09.06.2013 Views

Intel XENIX 286 Programmers Guide (86) - Tenox.tc

Intel XENIX 286 Programmers Guide (86) - Tenox.tc

Intel XENIX 286 Programmers Guide (86) - Tenox.tc

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 2<br />

cc: C COMPILER<br />

This chapter explains how to use the cc command. In particular, it explains how to<br />

• Compile C language source files<br />

• Choose a memory model for a program<br />

• Use object files and libraries with a program<br />

• Create smaller and faster programs<br />

• Prepare C programs for debugging<br />

• Control the C preprocessor<br />

It also describes the error and warning messages generated by the C compiler and<br />

explains how to use advanced features of the cc command to make customized<br />

programs.<br />

This chapter assumes that you are familiar with the C programming language and that<br />

you can create C program source files using a <strong>XENIX</strong> text editor.<br />

Invoking the C Compiler<br />

The cc command has the form<br />

cc [ option ] . . . filename ...<br />

where option is a command option, and filename is the name of a C language source file,<br />

an assembly language source file, an object file, or an archive library. You may give<br />

more than one option or file name, if desired, but you must separate each item with one<br />

or more spaces.<br />

The cc command options control and modify the tasks performed by the command. For<br />

example, you can direct cc to perform optimization or create an assembly listing file.<br />

The options also specify additional information about the compilation, such as which<br />

program libraries to examine and what the name of the executable file should be. Many<br />

options are described in the following sections. For a complete description of all<br />

options, see the entry cc in Appendix B, "Programming Commands."<br />

2-1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!