Confused about warnings in STLport

Hi,

I'm using C++5.7:

% CC -V

CC: Sun C++ 5.7 Patch 117830-08 2006/07/12

I'm trying to compile a rather big code base using increased warning level and turning warnings into errors.

I'm having trouble with STLport's fstream include file (using STLport that ships with the compiler):

/opt/tools/SunStudio10/SUNWspro/bin/CC -g -mt -KPIC -library=%none,stlport4 +w -errtags -erroff=notemsource,unknownpragma -xwe -c Config.cc

"/opt/tools/SunStudio10/SUNWspro/prod/include/CC/stlport4/stl/_fstream.h", line 566: Warning, hidef: std::ifstream::rdbuf hides the function std::ios::rdbuf(std::streambuf *).

"Config.cc", line 253:Where, temwhilespec: While specializing "std::ifstream ".

"Config.cc", line 253:Where, temspecend: Specialized in non-template code.

Reading some earlier posts on this forum (e.g. http://forum.java.sun.com/thread.jspa?forumID=850&threadID=5070415), I was under the impression that the flag -xwe would suppress warnings coming from system headers (although the documentation about this option makes no mention of it).

Does this exclude STLport headers?

Also according to the above mentioned post, bug number 6197919 had been filed in order to get the appropriate behaviour when using -errwarn flag.

But I run into the same issue:

/opt/tools/SunStudio10/SUNWspro/bin/CC -g -mt -KPIC -library=%none,stlport4 -errtags -erroff=notemsource,unknownpragma -errwarn -c Config.cc

"/opt/tools/SunStudio10/SUNWspro/prod/include/CC/stlport4/stl/_fstream.h", line 566: Warning, hidef: std::ifstream::rdbuf hides the function std::ios::rdbuf(std::streambuf *).

"Config.cc", line 253:Where, temwhilespec: While specializing "std::ifstream ".

"Config.cc", line 253:Where, temspecend: Specialized in non-template code.

I don't want to ignore the error tag "hidef" as I did find user code doing real mistakes with name hiding.

Hopefully I missed something...

Cheers,

Bertrand.

[2023 byte] By [_tib_a] at [2007-11-27 5:55:32]
# 1

This particular warning creates a special problem, because the C++ standard defines the iostream classes in such a way that an overload of rdbuf is hidden in a derived class. Over time, we have found and suppressed warnings like these that come from system headers.

A fix for this warning from stlport is in the next release, Sun Studio 12, which should be available Monday June 4.

If you have a service contract with Sun, you can request that this fix be backported to earlier compilers. The bug number is 6422467.

The only workarounds I can suggest are to disable the warning, don't use +w, or don't convert warnings to errors.

clamage45a at 2007-7-12 16:24:30 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2
Thanks a lot for your prompt feedback. I will check with our sys admins if we can get this fix backported to sun studio 10.Cheers,Bertrand.
_tib_a at 2007-7-12 16:24:30 > top of Java-index,Development Tools,Solaris and Linux Development Tools...