Studio 11 warning(2): ld: warning: symbol `clog' has differing types:

Again, I am compiling old code with Studio 11.

[exec] ld: warning: symbol `clog' has differing types:

[exec](file /nfs/other/prod_solaris/tools/sparc-SunOS5/sunstudio/11/S

UNWspro/lib/libiostream.so type=OBJT; file /usr/lib/libm.so type=FUNC);

[exec]/nfs/other/prod_solaris/tools/sparc-SunOS5/sunstudio/11/SUNWspr

o/lib/libiostream.so definition taken

It seems finally the compiler takes the libiostream.so. How to eliminate this warning?

[482 byte] By [icesummit] at [2007-11-26 11:48:27]
# 1

C99 introduced a new math function "clog" for complex log. The global symbol is spelled the same as the "classic" iostream object "clog" (standard error logging stream).

We made some changes in the classic iostream headers, the header <math.h>, and in libiostream.so.1 and libm.so.2 in /usr/lib to eliminate nearly all of the conflicts via symbol redefinition and weak symbols.

If you link old binaries into a new program on a recent Solaris version, you will see the warning about the conflict. Recompiling the old binaries with the new compiler on the new Solaris version should fix the problem.

If not, you need to get the current C++ Runtime Library (SUNWlibC) patches and libm patches for your Solaris version.

If you are using both the math clog and the iostream clog in the program, the warning about the name conflict is unavoidable, but is harmless and can be ignored.

clamage45 at 2007-7-7 12:00:49 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2
Thanks! today, I added an options -xarch=v9 , and the warning was not reported either. Is it also a right solution?Using ldd, it is showing to link libm.so.2 =>/usr/lib/sparcv9/libm.so.2
icesummit at 2007-7-7 12:00:49 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3
The -xarch=v9 option says to build a 64-bit program for use on 64-bit sparc processors. It is not related to clog issues.
clamage45 at 2007-7-7 12:00:49 > top of Java-index,Development Tools,Solaris and Linux Development Tools...