Skip Navigation Links | |
Exit Print View | |
Oracle Solaris Studio 12.3: C User's Guide Oracle Solaris Studio 12.3 Information Library |
1. Introduction to the C Compiler
2. C-Compiler Implementation-Specific Information
7.1 Overview of the Data Model Differences
7.2 Implementing Single Source Code
Helpful Types Such as unintptr_t
7.3 Converting to the LP64 Data Type Model
7.3.1 Integer and Pointer Size Change
7.3.2 Integer and Long Size Change
7.3.4 Pointer Arithmetic Instead of Integers
7.3.8 Beware of Implicit Declarations
7.3.9 sizeof( ) Is an Unsigned long
7.3.10 Use Casts to Show Your Intentions
7.3.11 Check Format String Conversion Operation
7.4 Other Conversion Considerations
7.4.1 Note: Derived Types That Have Grown in Size
7.4.2 Check for Side Effects of Changes
7.4.3 Check Literal Uses of long Still Make Sense
7.4.4 Use #ifdef for Explicit 32-bit Versus 64-bit Prototypes
7.4.5 Calling Convention Changes
7.5 Checklist for Getting Started
8. cscope: Interactively Examining a C Program
A. Compiler Options Grouped by Functionality
B. C Compiler Options Reference
C. Implementation-Defined ISO/IEC C99 Behavior
E. Implementation-Defined ISO/IEC C90 Behavior
H. Oracle Solaris Studio C: Differences Between K&R C and ISO C
This chapter provides the information you need for writing code for the 32–bit or the 64-bit compilation environment.
Once you try to write or modify code for both the 32-bit and 64-bit compilation environments, you face two basic issues:
Data type consistency between the different data-type models
Interaction between the applications using different data-type models
Maintaining a single code-source with as few #ifdefs as possible is usually better than maintaining multiple source trees. Therefore, this chapter provides guidelines for writing code that works correctly in both 32-bit and 64-bit compilation environments. In some cases, the conversion of current code requires only a recompilation and relinking with the 64-bit libraries. However, for those cases where code changes are required, this chapter discusses the tools and strategies that make conversion easier.