| C User's Guide |
Preface
This manual describes the Sun WorkShopTM 6 C programming language compiler along with ANSI C compiler-specific information. This manual describes the
lintprogram that you can use to examine your code, provides instructions for parallelizing your code, explains how to transition to ANSI/ISO compliant code, describes the incremental linker, and the interactive programcscope. In the back of this manual, there are several appendices with reference material such as ANSI C data representations, implementation defined behavior, the differences between Sun C (K & R) and Sun ANSI C, performance tuning, and converting applications to compile for the 64-bit environment.Multiplatform Release
This Sun WorkShop release supports versions 2.6, 7, and 8 of the SolarisTM SPARCTM Platform Edition and Solaris Intel Platform Edition Operating Environments.
Note The term "x86" refers to the Intel 8086 family of microprocessor chips, including the Pentium, Pentium Pro, and Pentium II processors and compatible microprocessor chips made by AMD and Cyrix. In this document, the term "x86" refers to the overall platform architecture, whereas "Intel Platform Edition" appears in the product name.
Access to Sun WorkShop Development Tools
Because Sun WorkShop product components and man pages do not install into the standard
/usr/bin/and/usr/share/mandirectories, you must change yourPATHandMANPATHenvironment variables to enable access to Sun WorkShop compilers and tools.To determine if you need to set your
PATHenvironment variable:1. Display the current value of thePATHvariable by typing:
%echo $PATH2. Review the output for a string of paths containing/opt/SUNWspro/bin/.
- If you find the paths, your
PATHvariable is already set to access Sun WorkShop development tools. If you do not find the paths, set yourPATHenvironment variable by following the instructions in this section.To determine if you need to set your
MANPATHenvironment variable:1. Request theworkshopman page by typing:
%man workshop2. Review the output, if any.
- If the
workshop(1) man page cannot be found or if the man page displayed is not for the current version of the software installed, follow the instructions in this section for setting yourMANPATHenvironment variable.
Note The information in this section assumes that your Sun WorkShop 6 products were installed in the/optdirectory. Contact your system administrator if your Sun WorkShop software is not installed in/opt.
The
PATHandMANPATHvariables should be set in your home.cshrcfile if you are using the C shell or in your home.profilefile if you are using the Bourne or Korn shells:
- To use Sun WorkShop commands, add the following to your
PATHvariable:
/opt/SUNWspro/bin
- To access Sun WorkShop man pages with the
mancommand, add the following to yourMANPATHvariable:
/opt/SUNWspro/man
For more information about the
PATHvariable, see thecsh(1),sh(1), andksh(1) man pages. For more information about theMANPATHvariable, see the man(1) man page. For more information about setting yourPATHandMANPATHvariables to access this release, see the Sun WorkShop 6 Installation Guide or your system administrator.How This Book Is Organized
Chapter 1, "Introduction to the C Compiler," provides information about the C compiler, including standards conformance, organization of the compiler, and C-related programming tools.
Chapter 2, "cc Compiler Options," describes the C compiler options. It includes sections on option syntax, the
ccoptions, and options passed to the linker.Chapter 3, "Sun ANSI/ISO C Compiler-Specific Information," documents those areas specific to the Sun ANSI C compiler.
Chapter 4, "Parallelizing Sun ANSI/ISO C Code," The Sun ANSI/ISO C compiler can optimize code to run on SPARC shared-memory multiprocessor machines.
Chapter 5, "Incremental Link Editor (ild)," describes incremental linking,
ild-specific features, example messages, andildoptions.Chapter 6, "lint Source Code Checker," describes the
lintprogram, its modes, options, messages, directives, and other helpful information.Chapter 7, "Transitioning to ANSI/ISO C," provides tips and strategies for writing ANSI C compliant code.
Chapter 8, "Converting Applications," provides the information you need to write code for the 32 bit or the 64-bit compilation environment.
Chapter 9, "cscope: Interactively Examining a C Program," is a tutorial for the
cscopebrowser which is provided with this release.Appendix A, "ANSI/ISO C Data Representations," describes how ANSI C represents data in storage and the mechanisms for passing arguments to functions.
Appendix B, "Implementation-Defined Behavior," describes the implementation-defined features of the Sun WorkShop C compiler.
Appendix C, "Performance Tuning (SPARC)," describes performance tuning on SPARC platforms.
Appendix D, "The Differences Between K&R Sun C and Sun ANSI/ISO C," describes the differences between the previous K&R Sun C and Sun ANSI C.
Typographic Conventions
TABLE P-1 shows the typographic conventions that are used in Sun WorkShop documentation.
Shell Prompts
TABLE P-2 shows the default system prompt and superuser prompt for the C shell, Bourne shell, and Korn shell.
TABLE P-2 Shell Prompts C shell %Bourne shell and Korn shell $C shell, Bourne shell, and Korn shell superuser #
Related Documentation
You can access documentation related to the subject matter of this book in the following ways:
- Through the Internet at the
docs.sun.comsm Web site. You can search for a specific book title or you can browse by subject, document collection, or product at the following Web site:
http://docs.sun.com- Through the installed Sun WorkShop products on your local system or network. Sun WorkShop 6 HTML documents (manuals, online help, man pages, component readme files, and release notes) are available with your installed Sun WorkShop 6 products. To access the HTML documentation, do one of the following:
- In any Sun WorkShop or Sun WorkShopTM TeamWare window, choose Help
About Documentation.
- In your NetscapeTM Communicator 4.0 or compatible version browser, open the following file:
- (Contact your system administrator if your Sun WorkShop software is not installed in the
/optdirectory.) Your browser displays an index of Sun WorkShop 6 HTML documents. To open a document in the index, click the document's title.TABLE P-3 lists related Sun WorkShop 6 manuals by document collection.
TABLE P-4 describes related Solaris documentation available through the
docs.sun.comWeb site.
|
Sun Microsystems, Inc. Copyright information. All rights reserved. Feedback |
Library | Contents | Previous | Next | Index |