VSI Openvms C Language Reference Manual
Total Page:16
File Type:pdf, Size:1020Kb
VSI OpenVMS C Language Reference Manual Document Number: DO-VIBHAA-008 Publication Date: May 2020 This document is the language reference manual for the VSI C language. 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-1 for OpenVMS VMS Software, Inc., (VSI) Bolton, Massachusetts, USA C Language Reference Manual 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, Itanium and IA64 are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. Java, the coffee cup logo, and all Java based marks are trademarks or registered trademarks of Oracle Corporation in the United States or other countries. Kerberos is a trademark of the Massachusetts Institute of Technology. Microsoft, Windows, Windows-NT and Microsoft XP are U.S. registered trademarks of Microsoft Corporation. Microsoft Vista is either a registered trademark or trademark of Microsoft Corporation in the United States and/or other countries. Motif is a registered trademark of The Open Group UNIX is a registered trademark of The Open Group. The VSI OpenVMS documentation set is available on CD. ii C Language Reference Manual Preface .................................................................................................................................... xi 1. Intended Audience ......................................................................................................... xi 2. Purpose of the ANSI Standard ........................................................................................ xi 3. Manual Structure .......................................................................................................... xii 4. Associated Documents .................................................................................................. xii 5. VSI Encourages Your Comments .................................................................................. xiii 6. How to Order Additional Documentation ...................................................................... xiii 7. Typographical Conventions .......................................................................................... xiii Chapter 1. Lexicon ................................................................................................................ 1 1.1. Character Set ............................................................................................................... 2 1.1.1. Trigraph Sequences ........................................................................................... 4 1.1.2. Digraph Sequences ............................................................................................ 4 1.2. Identifiers .................................................................................................................... 5 1.3. Universal Character Names .......................................................................................... 6 1.4. Comments .................................................................................................................... 6 1.5. Keywords .................................................................................................................... 7 1.6. Operators ..................................................................................................................... 8 1.7. Punctuators .................................................................................................................. 9 1.8. String Literals ............................................................................................................ 10 1.9. Constants ................................................................................................................... 11 1.9.1. Integer Constants ............................................................................................. 11 1.9.2. Floating-Point Constants .................................................................................. 13 1.9.2.1. Semantics ............................................................................................. 13 1.9.2.2. Floating-Point Type ............................................................................... 14 1.9.2.3. Hexadecimal Floating-Point Constants ................................................... 14 1.9.2.4. Examples .............................................................................................. 14 1.9.3. Character Constants ......................................................................................... 15 1.9.3.1. Wide Characters .................................................................................... 15 1.9.3.2. Multibyte Characters ............................................................................. 16 1.9.3.3. Character Escape Sequences .................................................................. 16 1.9.3.4. Numeric Escape Sequences ................................................................... 17 1.9.4. Enumeration Constants .................................................................................... 18 1.10. Header Files ............................................................................................................. 18 1.11. Limits ...................................................................................................................... 18 1.11.1. Translation Limits .......................................................................................... 19 1.11.2. Numerical Limits ........................................................................................... 19 1.11.3. Character Display .......................................................................................... 20 Chapter 2. Basic Concepts .................................................................................................. 21 2.1. Blocks ....................................................................................................................... 22 2.2. Compilation Units ...................................................................................................... 22 2.3. Scope ......................................................................................................................... 23 2.3.1. File Scope ....................................................................................................... 23 2.3.2. Block Scope .................................................................................................... 24 2.3.3. Function Scope ................................................................................................ 24 2.3.4. Function Prototype Scope ................................................................................ 24 2.4. Visibility .................................................................................................................... 24 2.5. Side Effects and Sequence Points ................................................................................ 25 2.6. Incomplete Type ......................................................................................................... 26 2.7. Compatible and Composite Types ............................................................................... 27 2.8. Linkage ...................................................................................................................... 29 2.9. Tentative Definitions .................................................................................................. 30 iii C Language Reference Manual 2.10. Storage Classes ........................................................................................................ 30 2.10.1. The auto Class ............................................................................................... 31 2.10.2. The register Class .......................................................................................... 31 2.10.3. The static Class ............................................................................................. 32 2.10.4. The extern Class ............................................................................................ 32 2.11. Storage-Class Modifiers ............................................................................................ 32 2.11.1. The __inline Modifier .................................................................................... 33 2.11.2. The inline Modifier ........................................................................................ 33 2.11.2.1. Example – Using the inline Function Specifier ...................................... 34