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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Note: The invocation of 64-bit mode using the -q64 option (either explicitly or<br />

using a stanza) automatically implies linkage in 64-bit mode. The compiler driver<br />

automatically and quietly generates the correct linker options (-b32 or -b64) to<br />

call the binder or the correct assembler option (-a32 or -a64) when calling the<br />

assembler. Therefore, these options do not need to be set by the user.<br />

Predefined __64BIT__ Macro<br />

When the compiler is invoked to compile for 64-bit mode, the preprocessor macro<br />

__64BIT__ is predefined. When it is invoked in 32-bit (default) mode, this macro<br />

is not defined. The variable can be tested through:<br />

or<br />

#if defined(__64BIT__)<br />

#ifdef __64BIT__<br />

to select lines of code (such as printf statements) that are appropriate for 64 or<br />

32-bit mode. The ability to choose execution mode (of the final executable) at<br />

compile time and the existence of the __64BIT__ macro implies there is no need<br />

for an application to determine its execution mode at run time.<br />

When the compiler is invoked to compile for 64-bit mode, this macro is set to a<br />

value of 1 internally, so that the C preprocessor and compiler will recognize it. It<br />

cannot be redefined or undefined. Any attempt at redefinition will fail.<br />

3.3.1.2 Fixed-Width Types<br />

There is a a set of types that maintain their width regardless of the compilation<br />

mode of the compiler. These types may be used if the program relies on an exact<br />

and unchanging size for the types.<br />

Programs that exchange formatted messages are, for example:<br />

• An X-windows server and client executing in different modes.<br />

• Processes running in different modes that share data (using shmat() to jointly<br />

access and change common memory areas).<br />

• Data files written by applications running in one mode and read by<br />

applications running in a different mode.<br />

All of these demand the availability of fixed-width types.<br />

ANSI introduced two sets of types. One is the signed fixed-size integral type:<br />

• int8_t<br />

• int16_t<br />

• int32_t<br />

• int64_t<br />

The other is the unsigned fixed-size integral type:<br />

• uint8_t<br />

• uint16_t<br />

• uint32_t<br />

• uint64_t<br />

64-Bit Enablement 59

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

Saved successfully!

Ooh no, something went wrong!