Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX 64-bit Porting and Transition Guide: HP 9000 Computers > Chapter 2 Summary of Changes

HP C

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

To generate 32-bit mode code to run on HP-UX 64-bit systems, no new compiler command line options are required.

To compile in 64-bit mode, use the +DD64 or +DA2.0W command line options.

NOTE: If you are porting from a previous release of HP-UX, be aware that extended ANSI mode (-Ae) is the default compilation mode since the HP-UX 10.30 release. See the HP C Programmer's Guide for information on how to port to ANSI mode.

The HP C compiler on HP-UX 11.0 includes support for both the 32-bit data model and the 64-bit data model. In 32-bit mode, ints, longs, and pointer types are 32 bits in size. In 64-bit mode, longs and pointers are 64-bits, and ints remain 32-bits. Table 2-1 “ Differences between HP-UX 32-bit and 64-bit Data Models” shows the differences in C data type sizes and alignments:

Table 2-1  Differences between HP-UX 32-bit and 64-bit Data Models

Data Type

32-bit Mode Size (bits)

32-bit Mode Alignment (bits)

64-bit Mode Size (bits)

64-bit Mode Alignment (bits)

int

32

32

32

32

long

32

32

64

64

pointer

32

32

64

64

 

You may need to make source code changes, when transitioning to the HP-UX 64-bit data model, to correct assumptions made about the size and relationship of int, long, and pointer data types. Examples of programs that will require change include:

  • Programs that assume that an int is the same size as a long.

  • Programs that assume that an int is the same size as a pointer.

  • Programs that perform arithmetic or comparison operations between ints, longs and pointers, and between signed numeric types and unsigned numeric types.

  • Programs that make assumptions about data item sizes and alignment in structures.

  • Programs that use hard-coded constants.

HP C 11.0 New Features. The following are new or changed HP C features included in the HP-UX 11.0 release:

Table 2-2 New and Changed HP C Features

Feature

What it Does

+DD64

Recommended option for compiling in 64-bit mode on the PA-RISC 2.0 architecture. The macros __LP64__ and _PA_RISC2_0 are #defined. (Same as +DA2.0W.)

+DA2.0W

Compiles in 64-bit mode for the PA-RISC 2.0 architecture. The macros __LP64__ and _PA_RISC2_0 are #defined. (Same as +DD64.)

+DA2.0N

Compiles in 32-bit mode (narrow mode) for the PA-RISC 2.0 architecture. The macro _PA_RISC2_0 is #defined. (Same as +DA2.0.)

+DD32

Compiles in 32-bit mode and creates code compatible with PA-RISC 1.1 architectures. (Same as +DA1.1 and +DAportable.)

+hugesize

Lowers the threshold for huge data objects allocated to the huge data space (.hbss).

-dynamic

Creates dynamically bound executables. The linker will look for shared libraries first and then archive libraries. This option is on by default when you compile in 64-bit mode.

-noshared

Creates statically bound executables. You cannot link to shared libraries if you specify this option.

+M1

Turns on platform migration warnings. These features may be unsupported in a future release.

+M2

Turns on HP-UX 64-bit data model warnings. (Use this option with the +DA2.0W or +DD64 options.)

__LP64__

Macro that is automatically defined by the HP C compiler when compiling in 64-bit mode. Can be used within conditional directives to isolate 64-bit mode code.

PACK or HP_ALIGN pragmas

Data alignment pragmas. The HP_ALIGN pragma includes support for 64-bit mode. The new PACK pragma provides a convenient way of specifying alignment.

lint

Identifies non-portable constructs. Use the +DD64 and +M2 options to lint when transitioning to the HP-UX 64-bit data model.

 

For More Information:

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1998 Hewlett-Packard Development Company, L.P.