
• • • • • • • C User's Guide >< • ~ • Third Edition • > • z • • 0 • u • • • • • • CONVEX Computer Corporation 3000 Waterview Parkway P.O. Box 833851 Richardson, TX 75083-3851 United States of America (214) 497-4000 C User's Guide Order No. DSW-086 Third Edition October 1994 CONVEX Press Richardson, Texas United States of America C User's Guide Order No. DSW-086 Copyright ©1994 CONVEX Computer Corporation All rights reserved. This document is copyrighted. This document may not, in whole or part, be copied, duplicated, reproduced, translated, electronically stored, or reduced to machine readable form without prior written consent from CONVEX Computer Corporation. Although the material contained herein has been carefully reviewed, CONVEX Computer Corporation does not warrant it to be free of errors or omissions. CONVEX reserves the right to make corrections, updates, revisions or changes to the information contained herein. CONVEX does not warrant the material described herein to be free of patent infringement. UNLESS PROVIDED OTHERWISE IN WRITING WITH CONVEX COMPUTER CORPORATION (CONVEX), THE PROGRAM DESCRIBED HEREIN IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. SOME STATES DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES. THE ABOVE EXCLUSION MAY NOT BE APPLICABLE TO ALL PURCHASERS BECAUSE WARRANTY RIGHTS CAN VARY FROM STATE TO STATE. IN NO EVENT WILL CONVEX BE LIABLE TO ANYONE FOR SPECIAL, COLLATERAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING ANY LOST PROFITS OR LOST SAVINGS, ARISING OUT OF THE USE OR INABILITY TO USE THIS PROGRAM. CONVEX WILL NOT BE LIABLE EVEN IF IT HAS BEEN NOTIFIED OF THE POSSIBILITY OF SUCH DAMAGE BY THE PURCHASER OR ANY THIRD PARTY. CONVEX and the CONVEX logo ("C") are registered trademarks of CONVEX Computer Corporation. CONVEX ClOO Series and C200 Series are trademarks of CONVEX Computer Corporation. Cl, Cl20, C201, C202, C210, C220, C230, and C240 are trademarks of CONVEX Computer Corporation. SPP-UX is a trademark of CONVEX Computer Corporation. CX/Motif is a trademark of CONVEX Computer Corporation. Exemplar and SPP-UX are trademarks of CONVEX Computer Corporation. HP-UX and HP Performance Architecture are registered trademarks of Hewlett-Packard Corporation. UNIX is a registered trademark of UNIX Systems Laboratories Inc., a wholly owned subsidiary of Novell, Inc. (') This book is recyclable including cover and binding. Printed in the United States of America Revision Information for C User's Guide Edition Document No. Description Third 720-000630-210 Released with CONVEX C software V6.l, October 1994. Second 720-000630-206 Released with CONVEX C software VS.O, January 1993. First 720-000630-205 Released with CONVEX C software V4.l, April 1991. Contents . ... F1gl.lre~ ........................................................ >e111 l'CJblEtS ........................................•................ X'\/ Ab.out this guide ....................................... xvii Organization ............................................................................ xvii Notational conventions ......................................................... xviii Associated documents ............................................................ xix C Series and SPP Series publications .............................. xix C Series publications ......................................................... xix SPP Series publications ....................................................... xx Other documents ................................................................ xxi Online man pages .............................................................. xxi Ordering documentation ....................................................... xxii Technical assistance ................................................................ xxii 1 Introduction . .. .. .. .. 1 What is a compiler? ..................................................................... 2 Creating a source file ................................................................... 2 Compiling one source file ........................................................... 2 Compiling more than one source file ........................................ 3 Compiler and linker .................................................................... 5 Libraries ........................................................................................ 6 2 Compiler fundamentals ......................... 9 Compiler features ........................................................................ 9 Multiple compilers on a single host .................................. 10 File naming conventions ..................................................... 10 Command line format ......................................................... 11 Compilation process .................................................................. 12 Compiler command line options ............................................. 12 Compatibility modes ........................................................... 13 Compatibility mode command-line options .............. 13 Example command lines ............................................... 14 Preprocessor options ........................................................... 15 Contents v Debugging option usage .............................................. 16 Creating dependencies ................................................. 16 Code generation options .................................................... 16 Diagnostic options ............................................................... 21 Debugging options .............................................................. 22 Optimization options .......................................................... 24 Miscellaneous options ........................................................ 35 Compatibility with options of other compilers .................... 36 Predefined symbols ................................................................... 37 Linker use ................................................................................... 42 Compiler options that affect linking ................................. 42 Additional linker options ................................................... 42 Environment variables ............................................................. 43 Compiler messages ................................................................... 44 Diagnostic messages ........................................................... 44 Optimization report ............................................................ 45 Runtime messages ............................................................... 45 Mixed compatibility modes ...................................... ............... 46 HP Compatibility ...................................................................... 47 Storage class extensions (SPP only) ........................................ 47 3 Compatibility modes ............................ 51 Modes defined ........................................................................... 51 Specifying compatibility modes .............................................. 52 Single-mode compilation examples .................................. 53 Mixed compatibility modes ............................................... 54 Mode conversion ....................................................................... 55 Porting to backward-compatible mode ............................ 55 Porting to extended mode .................................................. 57 Extended mode differences ..................................................... 58 Changes that prevent compilation .................................... 59 Semantic changes ................................................................ 60 Operations ...................................................................... 60 Expressions and declarations ....................................... 60 Constants and literals .................................................... 61 Functions and macros ................................................... 62 Operators and operands ............................................... 62 Header file changes ............................................................. 62 Future directions .................................................................. 63 Incompatibilities with Common C ......................................... 65 Language definition ............................................................ 65 Type specifiers ................................................................ 65 static and extern .................................................... 66 Multiple initializers ....................................................... 66 Casts ................................................................................ 66 Order of evaluation ....................................................... 66 Uninitialized variables .................................................. 67 vi C User's Guide Negative bit shifts .......................................................... 67 switch statements with pointers ............................... 67 Undefined functions ...................................................... 67 Functions returning short int or char ................. 67 Command line differences ................................................. 68 4 Development tools ................................ 69 Program development utilities ..............................................
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages355 Page
-
File Size-