Specifications
54 Troubleshooting and Portability Issues Chapter 4
32035 Rev. 3.22 November 2007
Compiler Usage Guidelines for AMD64 Platforms
Use portable, scalable data types like INT_PTR, UINT_PTR, LONG_PTR, and ULONG_PTR for
type-casting pointers.
Issues such as these can be detected by using the /Wp64 switch.
4.13 Sun Compilers (32-bit) for Solaris
This section addresses errors and unexpected results that may be encountered when using 32-bit Sun
compilers for Solaris.
4.13.1 Compilation Errors
Do you need ANSI-compliant code?
If a developer needs ANSI-compliant code, Sun Studio provides several switches to detect and print
errors and warnings about non-conforming constructs. The -Xc switch specifies ISO C compliance
without K&R extensions. A number of additional switches are available to check compliance with
various combinations of standards and extensions.
4.13.2 Compiled and Linked Code Generates Unexpected Results
Does your program depend on precise floating-point behavior? Does your program depend on the
exact implementation of the IEEE 754 floating-point standard?
The -fsimple[=n] switch (implied by the -fast switch) may cause the compiler to generate code that
does not comply with the IEEE 754 floating-point standard. To guarantee compliance with the IEEE
754 floating-point standard, this switch must be set to value 0.
Do you need access to a frame pointer register?
The compilers by default do not use the stack frame pointer register to improve performance. If this
register is needed for debugging or performance analysis tools, or for C++ exceptions, it can be
enabled with the -xregs=no%frameptr switch.