You can use the XL C/C++ compiler to develop both 32-bit and 64-bit applications. To do so, specify -q32 (the default) or -q64, respectively, during compilation.
| Data type | 32-bit mode | 64-bit mode | ||
|---|---|---|---|---|
| Size | Alignment | Size | Alignment | |
| long, unsigned long | 4 bytes | 4-byte boundaries | 8 bytes | 8-byte boundaries |
| pointer | 4 bytes | 4-byte boundaries | 8 bytes | 8-byte boundaries |
| size_t (system-defined unsigned long) | 4 bytes | 4-byte boundaries | 8 bytes | 8-byte boundaries |
| ptrdiff_t (system-defined long) | 4 bytes | 4-byte boundaries | 8 bytes | 8-byte boundaries |
When compiling in 32-bit or 64-bit mode, you can use the -qwarn64 option to help diagnose some issues related to porting applications. In either mode, the compiler immediately issues a warning if undesirable results, such as truncation or data loss, have occurred.
For suggestions on improving performance in 64-bit mode, see Optimize operations in 64-bit mode.