This manual, the C User's Guide describes the C 4.2 compiler. The standard language is referred to as ANSI C. The notation K&R C refers to Kernighan and Ritchie C, which is non-ANSI (or pre-ANSI) C.
Audience
This document is intended to assist software developers write programs in the C language. This book does not discuss basic concepts of C programming.
Document Organization
This book contains the following chapters:
Online Documentation
On-line documents are in the following formats:
The following C compiler documentation is provided in online books:
To view a man page using the man command:
Table P-2 describes the C man pages, and identifies the best uses for each man page.
Table P-3 Identifies the man pages containing C compiler related information.
The man man page describes the options available with the man command to browse man pages. Other tools, such as tkman, provide search features and hypertext links to the man pages listed in the "SEE ALSO" section of a man page.
% man command_name | lp
where command_name is cc, for example. Error and Warning Messages File
The Error and Warning Messages file, located in /opt/SUNWspro/READMEs/c_lint_errors, contains C compiler error and warning messages, and the lint program messages. Many of the messages are self-explanatory. To obtain a description of these messages and code examples, search the text file for a string from the generated message, or obtain its unique tag and search on that (cc -errtags=yes).
file: filename line: n empty constant expression after macro expansionObtain further explanation of this message by:
A more detailed description is displayed with the sample code generating the error message, and the message ID, or tag:
To print the Error and Warning Messages file, type:
% lp /opt/SUNWspro/READMEs/c_lint_errors
When an error occurs, the error message is preceded by a file name and line number. The line number is the line where a problem is diagnosed. Occasionally, the compiler must read the next token before it can diagnose a problem, in which case the line number in the message may be a higher line number than that of the offending line.
Note - The compiler displays many of the messages contained in this file only when used with the cc -v option. With this option, the compiler performs stricter semantics checking and, therefore, displays more diagnostic messages.
C 4.2 README file
The C 4.2 README file, located in /opt/SUNWspro/READMEs/c, contains important information about the compiler, such as:
To view a PostScript file online, type:
% imagetool filename &To print a PostScript file, type:
% lp filename
Table P-5 describes the typographic notations used for arguments to the compiler and lint tool options.
Other Documentation Conventions
Operating Environments and Platform-Specific References
The C 4.2 documentation supports the following operating environments:
Shell |
Prompt |
C shell prompt |
machine_name% |
C shell superuser prompt |
machine_name# |
Bourne shell and Korn shell prompt |
$ |
Bourne shell and Korn shell superuser prompt |
# |