110x Filetype PDF File size 1.61 MB Source: vmssoftware.com
VSI OpenVMS C++ User's Guide for OpenVMS Systems Document Number: DO-VIBHAA-012 Publication Date: May 2020 This manual contains information about developing VSI C++ programs on OpenVMS systems and describes related language features. Revision Update Information: This is a new manual. Operating System and Version: VSI OpenVMS I64 Version 8.4-1H1 VSI OpenVMS Alpha Version 8.4-2L1 Software Version: VSI C++ Version 7.4-6 for OpenVMS I64 VSI C++ Version 7.4-8 for OpenVMS Alpha VMS Software, Inc., (VSI) Bolton, Massachusetts, USA C++ User's Guide for OpenVMS Systems Copyright © 2020 VMS Software, Inc. (VSI), Bolton, Massachusetts, USA Legal Notice Confidential computer software. Valid license from VSI required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license. The information contained herein is subject to change without notice. The only warranties for VSI products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. VSI shall not be liable for technical or editorial errors or omissions contained herein. HPE, HPE Integrity, HPE Alpha, and HPE Proliant are trademarks or registered trademarks of Hewlett Packard Enterprise. Intel and Itanium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. UNIX is a registered trademark of The Open Group. X/Open is a registered trademark of X/Open Company Ltd. in the UK and other countries. Portions of the ANSI C++ Standard Library have been implemented using source licensed from and copyrighted by Rogue Wave Software, Inc. Information pertaining to the C++ Standard Library has been edited and reprinted with permission of Rogue Wave Software, Inc. All rights reserved. Portions copyright 1994-2002 Rogue Wave Software, Inc. The VSI OpenVMS documentation set is available on CD. ii C++ User's Guide for OpenVMS Systems Preface .................................................................................................................................... ix 1. About VSI ..................................................................................................................... ix 2. Intended Audience ......................................................................................................... ix 3. Document Structure ....................................................................................................... ix 4. Associated Documents .................................................................................................... x 5. Related Documents ......................................................................................................... x 6. VSI Encourages Your Comments .................................................................................... xi 7. How to Order Additional Documentation ........................................................................ xi 8. Platform Labels ............................................................................................................. xi 9. Typographical Conventions ............................................................................................ xi 10. New and Changed Features in C++ I64 Version 7.2 ...................................................... xii 11. New and Changed Features in C++ Version 7.1 ............................................................ xii Chapter 1. Building and Running C++ Programs ............................................................. 1 1.1. Using the DECTPU Text Editor .................................................................................... 2 1.2. Using the Compiler ...................................................................................................... 2 1.2.1. Compiler Command Qualifiers ........................................................................... 2 1.2.2. Compiler Error Messages ................................................................................... 3 1.3. Linking a Program (Alpha only) ................................................................................... 3 1.3.1. CXXLINK Interactions with OpenVMS Linker Qualifiers ................................... 4 1.3.1.1. Command Parameters and Qualifier ......................................................... 4 1.3.2. Migrating from LINK to CXXLINK .................................................................. 5 1.3.3. Linking to the C++ Standard Library .................................................................. 5 1.3.4. Linking to the C++ Class Library ....................................................................... 6 1.3.4.1. Linking Against the Class Library Object Library ..................................... 6 1.3.4.2. Linking Against the Class Library Shareable Image .................................. 6 1.3.5. Linker Command Qualifiers ............................................................................... 7 1.3.6. Linker Error Messages ....................................................................................... 7 1.4. Linking a Program (I64 only) ....................................................................................... 8 1.4.1. Linking Against C++ Class and Standard Library Shareable Images ..................... 8 1.4.2. Linking Against the Object Library (Linking /NOSYSSHARE) ............................ 9 1.5. Running a C++ Program .............................................................................................. 9 1.5.1. Run-Time Errors ............................................................................................... 9 1.5.2. Passing Arguments to the main Function .......................................................... 10 1.6. Name Demangling ...................................................................................................... 11 1.6.1. Creating the Data File ...................................................................................... 12 1.6.2. Using the CXXDEMANGLE Facility ............................................................... 12 1.6.2.1. Command Qualifier ............................................................................... 13 1.7. Performance Optimization Qualifiers ........................................................................... 13 1.8. Improving Build Performance ..................................................................................... 14 1.9. Deploying Your Application ....................................................................................... 14 1.9.1. Redistribution of the DECC$CRTL.OLB Object Library .................................... 14 1.9.2. Redistribution of the LIBCXXSTD.OLB Object Library .................................... 15 Chapter 2. VSI C++ Implementation ................................................................................ 17 2.1. Implementation-Specific Attributes .............................................................................. 17 2.1.1. #pragma Preprocessor Directive ....................................................................... 17 2.1.1.1. #pragma [no]builtins ............................................................................. 17 2.1.1.2. #pragma define_template Directive ........................................................ 17 2.1.1.3. #pragma environment Directive ............................................................. 17 2.1.1.4. #pragma extern_model Directive ........................................................... 19 2.1.1.5. #pragma extern_prefix Directive ............................................................ 23 2.1.1.6. #pragma function Directive ................................................................... 24 iii C++ User's Guide for OpenVMS Systems 2.1.1.7. #pragma include_directory Directive ...................................................... 24 2.1.1.8. #pragma [no]inline Directive ................................................................. 25 2.1.1.9. #pragma intrinsic Directive ................................................................... 25 2.1.1.10. #pragma [no]member_alignment Directive ........................................... 26 2.1.1.11. #pragma message Directive ................................................................. 27 2.1.1.12. #pragma module Directive ................................................................... 29 2.1.1.13. #pragma once Directive ....................................................................... 29 2.1.1.14. #pragma pack Directive ....................................................................... 29 2.1.1.15. #pragma unroll Directive (Alpha only) ................................................. 31 2.1.1.16. #pragma [no]standard Directive ........................................................... 31 2.1.2. Predefined Macros and Names ......................................................................... 31 2.1.3. Translation Limits ............................................................................................ 35 2.1.4. Numerical Limits ............................................................................................. 35 2.1.5. Argument-Passing and Return Mechanisms ....................................................... 36 2.2. Implementation Extensions and Features ..................................................................... 36 2.2.1. Identifiers ........................................................................................................ 36 2.2.1.1. External Name Encoding ....................................................................... 36 2.2.1.2. Modifying Long Names ........................................................................ 37 2.2.2. Order of Static Object Initialization .................................................................. 38 2.2.3. Integral Conversions ........................................................................................ 38 2.2.4. Floating-Point Conversions .............................................................................. 38 2.2.5. Explicit Type Conversion ................................................................................. 38 2.2.6. The sizeof Operator ......................................................................................... 39 2.2.7. Explicit Type Conversion ................................................................................. 39 2.2.8. Multiplicative Operators ................................................................................... 39 2.2.9. Additive Operators (§r.5.7) ............................................................................... 39 2.2.10. Shift Operators (§r.5.8) .................................................................................. 39 2.2.11. Equality Operators ......................................................................................... 39 2.2.12. Type Specifiers .............................................................................................. 40 2.2.13. asm Declarations (Alpha only) ........................................................................ 40 2.2.14. Linkage Specifications ................................................................................... 40 2.2.15. Class Layout ................................................................................................. 40 2.2.15.1. Structure Alignment ............................................................................ 40 2.2.15.2. Bit-Fields ............................................................................................ 41 2.2.15.3. Access Specifiers ................................................................................ 41 2.2.15.4. Class Subobject Offsets ....................................................................... 41 2.2.16. Virtual Function and Base Class Tables ........................................................... 42 2.2.17. Multiple Base Classes .................................................................................... 42 2.2.18. Temporary Objects ......................................................................................... 43 2.2.18.1. Lifetime of Temporary Objects ............................................................ 43 2.2.18.2. Nonconstant Reference Initialization with a Temporary Object ............... 44 2.2.18.3. Static Member Functions Selected by Expressions Creating Temporary Objects ............................................................................................................. 44 2.2.19. File Inclusion ................................................................................................ 44 2.2.20. Nested Enums and Overloading ...................................................................... 48 2.2.21. Guiding Declarations ..................................................................................... 49 2.3. Alternative Tokens ..................................................................................................... 49 2.4. Run-time Type Identification ...................................................................................... 50 2.5. Message Control and Information Options ................................................................... 50 Chapter 3. C++ Language Environment ........................................................................... 53 3.1. cname Headers ........................................................................................................... 53 3.2. Using Existing C Header Files .................................................................................... 53 iv
no reviews yet
Please Login to review.