How to suppress warning selectively in Sun8 CC6.0

Hello,

I am using CC: Sun WorkShop 6 update 2 C++ 5.3 Patch 111685-14 2003/03/24 compiler.

Machine Sun8.

Getting a lot of waring from libC++(ostream/iosteam/map etc).

Is there anyway to suppress selectively these warnings.

Urgent!! Please,

-mukti

"/software/forte/6.2_unpatched/SUNWspro/WS6U2/include/CC/Cstd/./ostream", line 73:Where: While specializing "std::basic_ios<char, std::char_traits><char>>".

"/software/forte/6.2_unpatched/SUNWspro/WS6U2/include/CC/Cstd/./ostream", line 73:Where: Specialized in std::basic_ostream<char, std::char_traits><char>>.

"/software/forte/6.2_unpatched/SUNWspro/WS6U2/include/CC/Cstd/./ostream", line 363:Where: Specialized in non-template code.

"/software/forte/6.2_unpatched/SUNWspro/WS6U2/include/CC/Cstd/./ios", line 148: Warning: std::basic_ios<wchar_t, std::char_traits><wchar_t>>::copyfmt hides the function std::ios_base::copyfmt(const std::ios_base&).

"/software/forte/6.2_unpatched/SUNWspro/WS6U2/include/CC/Cstd/./ostream", line 73:Where: While specializing "std::basic_ios<wchar_t, std::char_traits><wchar_t>>".

"/software/forte/6.2_unpatched/SUNWspro/WS6U2/include/CC/Cstd/./ostream", line 73:Where: Specialized in std::basic_ostream<wchar_t, std::char_traits><wchar_t>>.

"/software/forte/6.2_unpatched/SUNWspro/WS6U2/include/CC/Cstd/./ostream", line 366:Where: Specialized in non-template code.

"/software/forte/6.2_unpatched/SUNWspro/WS6U2/include/CC/Cstd/./utility", line 101: Warning: "std::basic_string<char, std::char_traits><char>, std::allocator<char>>::basic_string(const std::basic_string<char, std::char_traits><char>, std::allocator<char>>&)" is too large and will not be expanded inline.

"/software/forte/6.2_unpatched/SUNWspro/WS6U2/include/CC/Cstd/./string", line 283: Warning: "std::basic_string<char, std::char_traits><char>, std::allocator<char>>::__unLink()" is too large and will not be expanded inline.

"/software/forte/6.2_unpatched/SUNWspro/WS6U2/include/CC/Cstd/rw/tree", line 499: Warning: "__rwstd::__rb_tree<std::basic_string><char, std::char_traits><char>, std::allocator<char>>, std::pair<const std::basic_string><char, std::char_traits><char>, std::allocator<char>>, int>, __rwstd::__select1st<std::pair><const std::basic_string><char, std::char_traits><char>, std::allocator<char>>, int>, std::basic_string<char, std::char_traits><char>, std::allocator<char>>>, std::less<std::basic_string><char, std::char_traits><char>, std::allocator<char>>>, std::allocator<std::pair><const std::basic_string><char, std::char_traits><char>, std::allocator<char>>, int>>>::init()" is too large and will not be expanded inline.

5 Warning(s) detected.

=============================================================

Creating TvlParser layer object /u/mukti/Projects/TDL/TvlParser/Makefiles/../CompiledObjects/TDL/SUN32_SCC/Para meterValue.o from /u/mukti/Projects/TDL/TvlParser/Makefiles/../Source/TvlParser/ParameterValue.c

=============================================================

/software/forte/6.2_unpatched/SUNWspro/bin/CC -c -features=no%conststrings -features=no%localfor -KPIC -xO4 +w -I/u/mukti/Projects/TDL/TvlParser/Makefiles/../Includes/AccessData/ -I/u/mukti/Projects/TDL/TvlParser/Makefiles/../Includes/Apps/ -I/u/mukti/Projects/TDL/TvlParser/Makefiles/../Includes/BasicParameter++/ -I/u/mukti/Projects/TDL/TvlParser/Makefiles/../Includes/Common/ -I/u/mukti/Projects/TDL/TvlParser/Makefiles/../Includes/Context/ -I/u/mukti/Projects/TDL/TvlParser/Makefiles/../Includes/MessageHandler/ -I/u/mukti/Projects/TDL/TvlParser/Makefiles/../Includes/Parser/ -I/u/mukti/Projects/TDL/TvlParser/Makefiles/../Includes/Parser/TI_TDL -I/u/mukti/Projects/TDL/TvlParser/Makefiles/../Includes/PersistData/ -I/u/mukti/Projects/TDL/TvlParser/Makefiles/../Includes/TvlParser++/ -I/u/mukti/Projects/TDL/TvlParser/Makefiles/../Source/Parser/TI_TDL/ -I/u/mukti/Projects/TDL/TvlParser/Makefiles/../CompiledObjects/TDL/SUN32_SCC/ /u/mukti/Projects/TDL/TvlParser/Makefiles/../Source/TvlParser/ParameterValue.c -o /u/mukti/Projects/TDL/TvlParser/Makefiles/../CompiledObjects/TDL/SUN32_SCC/Para meterValue.o

"/software/forte/6.2_unpatched/SUNWspro/WS6U2/include/CC/Cstd/./ios", line 148: Warning: std::basic_ios<char, std::char_traits><char>>::copyfmt hides the function std::ios_base::copyfmt(const std::ios_base&).

"/software/forte/6.2_unpatched/SUNWspro/WS6U2/include/CC/Cstd/./ostream", line 73:Where: While specializing "std::basic_ios<char, std::char_traits><char>>".

"/software/forte/6.2_unpatched/SUNWspro/WS6U2/include/CC/Cstd/./ostream", line 73:Where: Specialized in std::basic_ostream<char, std::char_traits><char>>.

"/software/forte/6.2_unpatched/SUNWspro/WS6U2/include/CC/Cstd/./ostream", line 363:Where: Specialized in non-template code.

"/software/forte/6.2_unpatched/SUNWspro/WS6U2/include/CC/Cstd/./ios", line 148: Warning: std::basic_ios<wchar_t, std::char_traits><wchar_t>>::copyfmt hides the function std::ios_base::copyfmt(const std::ios_base&).

"/software/forte/6.2_unpatched/SUNWspro/WS6U2/include/CC/Cstd/./ostream", line 73:Where: While specializing "std::basic_ios<wchar_t, std::char_traits><wchar_t>>".

[5670 byte] By [muktipadaa] at [2007-11-27 1:58:23]
# 1
Use -errtags=yes to get tag name for this warning. After that use -erroff=no%tag to switch off this warning.
Atanasyana at 2007-7-12 1:35:01 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2
Thanks!I tried to use, and got a warning instead of getting error ID.CC: Warning: Option -errtags=yes passed to ld, if ld is invoked, ignored otherwise-mukti
muktipadaa at 2007-7-12 1:35:01 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3
Sorry, -errtag is only available since CC version 5.6 and you are using 5.3
MaximKartasheva at 2007-7-12 1:35:01 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 4
Thanks.Is there any solution for CC 5.3 to suppress selectively.-mukti
muktipadaa at 2007-7-12 1:35:01 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 5

Hi

It looks like you are using an unpatched and unsupported compiler. Is there any reason why you can't switch to Sun Studio 11 (zero cost, supported)?

If you really can't upgrade, then you could write a little filter script that wraps CC. E.g., for a simplistic example:

#!/bin/sh

# script 'CCfilt'

CC "$@" 2>&1 | nawk '

/Warning: -xarch=native/ {

next

}

{

print

}'

You'd have to add regexps for the warnings you want filtered. Then in your Makefile, set CXX=CCfilt

You can probably find something more sophisticated on the web. The main problem with the above is that it redirects stderr to stdout, which might cause some problems.

Paul

Paul_Floyda at 2007-7-12 1:35:01 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 6

Thanks!

Basically you are talking of grep kind of stuff.

Earlier we were using Patched one. But forced to get a unpatched one because of

following issue.

If you are using STL in your code and you are building a C++

library using CC5.3 patched CC version and that library is linked by an

application using a lower version CC, you will

get some undefined symbols (__sun_append, __sun_concat etc.) during

linking.

Can you please tell me how I can get Sun Studio 11 (zero cost, supported)?

is it stable? And does not show up above linking issue.

-mukti

muktipadaa at 2007-7-12 1:35:02 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 7
Sun Studio 11, which stable, can be downloaded here: http://developers.sun.com/sunstudio/downloads/index.jsp
MaximKartasheva at 2007-7-12 1:35:02 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 8

One warning at upgrading. We're still using Sun Studio 8 because anything above that requires OS patches to be installed On Solaris 8. This is an issue if you want to sell to a customer that only allows security patches.

Of course, with Solaris 8 disappearing, does Solaris 9 require patching? I believe it does, which is why we're still stuck with Sun Studio 8 on that platform as well.

If it weren't for stubborn customers, I'd be running Sun Studio 11 in a flash. I'm hoping to outlive the EOL for Solaris 9 so this issue will be moot.

Gary

GAGendela at 2007-7-12 1:35:02 > top of Java-index,Development Tools,Solaris and Linux Development Tools...