24.05.2014 Views

AIX Version 4.3 Differences Guide

AIX Version 4.3 Differences Guide

AIX Version 4.3 Differences Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

platform. You may recompile the code in 64-bit mode to check performance<br />

implications in 64-bit mode on a 64-bit platform.<br />

While most code will recompile and execute properly in 64-bit mode, some code<br />

will behave differently, or may not function at all, due to nonportability deliberately<br />

or accidentally written into the code. Common causes of behavior changes are<br />

due to mixed use of long and int types in operators, especially comparison<br />

operators that will change the code execution path. Although the usual operand<br />

promotion rules do not change, the changed size of long types may yield<br />

surprising and unexpected results. Function arguments and return types from<br />

functions need to be checked for their actual value. Many library functions return<br />

long types and take long types that are implicit, such as size_t and ptrdiff_t.<br />

Structures, structure alignments, member alignments, bit fields, and enums are<br />

guaranteed to change when compiled in 64-bit mode (especially if they contain<br />

long and pointer types).<br />

3.3.1.1 Compiler Mode<br />

The generation of 64-bit instructions and 64-bit XCOFF is called the 64-bit<br />

compilation mode. The compiler invocation for setting the 64-bit versus 32-bit<br />

mode evaluates several sources. They are:<br />

• Internal default<br />

• Environment variable OBJECT_MODE<br />

• Configuration file<br />

• Command line<br />

• Source file<br />

The compiler evaluates the options in the given order of the items. The last one<br />

takes precedence. For example, if the environment variable OBJECT_MODE<br />

exists, it will replace the internal default of the compiler. Table 14 provides a list of<br />

OBJECT_MODE settings and the compilation mode behavior.<br />

Table 14. Settings for OBJECT_MODE and the Resulting Compiler Behavior<br />

OBJECT_MODE setting<br />

not set<br />

Compilation Mode Behavior<br />

32-bit mode<br />

32 32-bit mode<br />

64 64-bit mode<br />

32_64 fatal error and stop (unless there is explicit user setting<br />

in the config file or command line) with message:<br />

1501-054 OBJECT_MODE=32_64 is for mixed-mode<br />

and is not a valid setting for the compiler.<br />

anything else<br />

fatal error and stop (unless there is explicit user setting<br />

in the config file or command line) with message:<br />

1501-055 OBJECT_MODE setting is not recognized<br />

and is not a valid setting for the compiler.<br />

This option allows the code to function in a 32- or 64-bit environment without<br />

excessive use of new option names. This will maintain compatibility with other<br />

tools that can exhibit 32/64-bit mode behavior since they will all use the<br />

OBJECT_MODE environment variable. It also maintains compatibility with<br />

machines without 64-bit capability that want to compile in 64-bit mode. In all<br />

64-Bit Enablement 57

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!