Last updated on SEPTEMBER 06, 2017
Applies to:Oracle Solaris Studio - Version 12.5 and later
Information in this document applies to any platform.
Studio 12.4 and 12.5, -xport64 flag not issuing warnings
In the 12.4 and 12.5 versions of the Solaris Studio C++ compiler the -xport64 option no longer produces the 64-bit portability warnings that the current 12.3 version of the compiler produces.
Here is an example of the problem. Note that only 12.3 reports the 64-bit warnings:
$ /opt/developerstudio12.5/bin/CC -xport64=full -compat=5 -m64
$ /opt/studio12.4/bin/CC -xport64=full -compat=5 -m64 type_cast3.cpp
$ /opt/studio12.3/bin/CC -xport64=full -compat=5 -m64 type_cast3.cpp
"type_cast3.cpp", line 4: Warning: Converting an "int" into a 64-bit integer
causes sign extension.
"type_cast3.cpp", line 5: Warning: Converting a 64-bit type value to "int"
2 Warning(s) detected.
$ cat type_cast3.cpp
int i = -1;
unsigned long ul = i; // should cause sign-extension error
int i2 = ul; // should cause truncation error
Sign In with your My Oracle Support account
Don't have a My Oracle Support account? Click to get started
My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms