C/C++ Reference Manual
Total Page:16
File Type:pdf, Size:1020Kb
C/C++ Reference Manual 0890497-040 July 2004 Copyright 2004 by Concurrent Computer Corporation. All rights reserved. This publication or any part thereof is intended for use with Concurrent Computer Corporation products by Concurrent Computer Corporation personnel, customers, and end–users. It may not be reproduced in any form without the written permission of the publisher. The information contained in this document is believed to be correct at the time of publication. It is subject to change without notice. Concurrent Computer Corporation makes no warranties, expressed or implied, concerning the information contained in this document. To report an error or comment on a specific portion of the manual, photocopy the page in question and mark the correction or comment on the copy. Mail the copy (and any additional comments) to Concurrent Computer Corpora- tion, 2881 Gateway Drive Pompano Beach FL 33069. Mark the envelope “Attention: Publications Department.” This publication may not be reproduced for any other reason in any form without written permission of the publisher. Acknowledgment: This manual contains material contributed by Edison Design Group, Inc. Those portions are copyrighted and reproduced with permission. The license management portion of this product is based on: Élan License Manager Copyright 1989-1993 Elan Computer Group, Inc. All rights reserved. Élan License Manager is a trademark of Élan Computer Group, Inc. NightView and PowerMAX OS are trademarks of Concurrent Computer Corporation. POSIX is a trademark of the Institute of Electrical and Electronics Engineers, Inc. IBM and Power PC are trademarks of IBM Corp. UNIX is a registered trademark licensed exclusively by the X/Open Company Ltd. X is a trademark of The Open Group. HyperHelp is a trademark of Bristol Technology Inc. Printed in U. S. A. Preface Scope of Manual This manual is a reference document on Concurrent C/C++, two general-purpose pro- gramming languages. Information in this manual applies to the platforms described in the latest Concurrent Computer Corporation product catalogs. System manual page (man page) descriptions of programs, system calls and subroutines can be found online. Syntax Notation The following notation is used throughout this guide: italic Books, reference cards, and items that the user must specify appear in italic type. Special terms may also appear in italic. list bold User input appears in list bold type and must be entered exactly as shown. Names of directories, files, commands, options and man page references also appear in list bold type. list Operating system and program output such as prompts and messages and listings of files and programs appears in list type. [] Brackets enclose command options and arguments that are optional. You do not type the brackets if you choose to specify such option or arguments. {} Braces enclose mutually exclusive choices separated by the pipe (|) character, where one choice must be selected. You do not type the braces with the choice. ... An ellipsis follows an item that can be repeated. ::= This symbol means “is defined as” in Backus-Naur Form (BNF). i C/C++ Reference Manual Referenced Publications The following Concurrent publications are referenced in this document: 0890459 Compilation Systems Volume 1 (Tools) 0890460 Compilation Systems Volume 2 (Concepts) ii Contents Chapter 1 Compilation Compilation Phases . 1-2 Compiler Invocation . 1-5 Program Development Environment . 1-5 Multiple Release Support . 1-6 Using Concurrent C/C++ with the PLDE . 1-6 PATH Considerations . 1-6 Include Files and Libraries . 1-7 OS Versions and Target Architectures . 1-8 Shared vs. Static Linking . 1-9 Makefile Considerations. 1-11 Explicit Modification Using ec/ec++ . 1-11 Use of /usr/ccs/crossbin in PATH Environment Variable . 1-11 Use of CC Environment or Make Variables . 1-11 Invoking the Compiler. 1-13 Command Line Options . 1-14 Compilation Process . 1-14 Preprocessing . 1-14 Key Characters . 1-16 C++ Specific Features . 1-18 Error Messages. 1-19 Other. 1-20 Language Dialect. 1-24 Optimization . 1-34 Linking . 1-41 Chapter 2 Using the Program Development Environment Hello World - An Example . 2-1 Creating an environment . 2-1 Introducing units. 2-2 Defining a partition. 2-3 Building a partition . 2-4 Success!!! . 2-4 Let’s look around.... 2-4 Listing the contents of your environment . 2-4 Viewing the source for a particular unit . 2-5 Looking at the Environment Search Path . 2-6 What are my options? . 2-6 Hello Galaxy - The Example Continues.... 2-11 Modifying an existing unit . 2-11 Building a unit with references outside the local environment . 2-12 Adding an environment to the Environment Search Path . 2-13 Making contact!!! . 2-13 Who resides here now?. 2-13 iii C/C++ Reference Manual Conclusion . 2-15 Chapter 3 Program Development Environment Concepts Environments . 3-1 Local Environments . 3-2 Foreign Environments. 3-2 Environment Search Path . 3-2 Naturalization . 3-2 Fetching . 3-3 Freezing Environments . 3-3 Environment-wide Compile Options . 3-3 Units. 3-3 Unit Identification. 3-4 Nationalities . 3-4 Local Units . 3-4 Foreign Units . 3-5 Artificial Units . 3-5 Unit Compile Options. 3-5 Partitions . 3-5 Types of Partitions . 3-6 Executable Partitions . 3-6 Archives. 3-6 Shared Objects. 3-6 Lazy Versus Immediate Binding . 3-7 Position Independent Code. 3-7 Share Path. 3-7 Issues to consider . 3-7 Object Files . ..