Sun WorkShop Compiler C 5.0 User's Guide

Chapter 1 Introduction to the C Compiler

This chapter provides information about the C compiler, including operating environments, standards conformance, organization of the compiler, and C-related programming tools. For an explanation of the specific operating environments supported in this release, refer to the README file.

Standards Conformance

The compiler conforms to the American National Standard for Programming Language - C, ANSI/ISO 9899-1990. It also conforms to ISO/IEC 9899:1990, Programming Languages - C. Finally, this compiler conforms to FIPS 160. Because the compiler also supports traditional K&R C (Kernighan and Ritchie, or pre-ANSI C), it can ease your migration to ANSI/ISO C.

Organization of the Compiler

The C compilation system consists of a compiler, an assembler, and a link editor. The cc command invokes each of these components automatically unless you use command-line options to specify otherwise.

Chapter 2, cc Compiler Options," discusses all the options available with cc.

The following figure shows the organization of the C compilation system.

Figure 1-1 Organization of the C Compilation System

Graphic

The following table summarizes the components of the compilation system.

Table 1-1 Components of the C Compilation System

Component 

Description 

Notes on Use 

 cpp

Preprocessor 

 -Xs
 acomp

Compiler (preprocessor built in for non-Xs modes)

 

 iropt

Code optimizer 

(SPARC) -O, -xO [2-5], -fast

 cg386

Intermediate language translator 

(Intel) Always invoked

 inline

Inline expansion of assembly language templates 

.il file specified

 mwinline

Automatic inline expansion of functions 

(Intel) -xO4, -xinline

 fbe

Assembler 

 

 cg

Code generator, inliner, assembler 

(SPARC)

 codegen

Code generator 

(Intel)

 ld

Linker 

 

 ild

Incremental linker 

(SPARC) -g, -xildon

The C compiler optimizer removes redundancies, optimally allocates registers, schedules instructions, and reorganizes code. Select from multiple levels of optimization to obtain the best balance between application speed and use of memory.

C-Related Programming Tools

There are a number of tools available to aid in developing, maintaining, and improving your C programs. The two most closely tied to C, cscope and lint, are described in this book. Others are described in the Solaris reference or programming documentation and/or Performance Profiling Tools. In addition, a man page exists for each of these tools. Refer to the preface of this book for a list of all the associated man pages.