[function] Bug in 1.34.0 with Sun Studio on Solaris

Hi, I get the following warnings when using a boost::thread_specific_ptr<unsigned int> and compiling with Sun Studio 11 (with latest patches) or Sun Studio 12 on Solaris x86. Warning: Could not find source for boost::type_traits::ice_not<0>::value. "../../../build/debug/include/boost/function/function_template.hpp", line 407: Warning: Could not find source for boost::detail::function::function_allows_small_object_optimization<boost::detail::tss_adapter<unsigned>>::value. A similar warning is reported when I use boost::bind. Every comment is apreciated. Markus

On Wed, Jun 06, 2007 at 02:46:14AM +0200, Markus Bernhardt wrote:
I get the following warnings when using a boost::thread_specific_ptr<unsigned int> and compiling with Sun Studio 11 (with latest patches) or Sun Studio 12 on Solaris x86.
Warning: Could not find source for boost::type_traits::ice_not<0>::value.
As far as I understood from the Solaris docs, this warning is harmless. The SunCC compiler has a "smart" template-compilation model which allows you to only DECLARE template classes in X.h, and the compiler will automatically look for definitions in X.cc. If X.cc does not exist, it emits the warning. This "searching" process is fully described in the manual. I get it even on some of my own code, but it works when run. Look at sections 7.5 and 5.2 in the following links: http://docs.sun.com/source/819-3690/Compiling_Templates.html http://docs.sun.com/source/819-3690/Program_Org.html#24618 It seems that the option -template=no%extdef should help (-template=extdef is the default).

Am Mi 06.06.2007 08:21 schrieb Zeljko Vrba <zvrba@ifi.uio.no>:
On Wed, Jun 06, 2007 at 02:46:14AM +0200, Markus Bernhardt wrote:
I get the following warnings when using a boost::thread_specific_ptr<unsigned int> and compiling with Sun Studio 11 (with latest patches) or Sun Studio 12 on Solaris x86.
Warning: Could not find source for boost::type_traits::ice_not<0>::value.
As far as I understood from the Solaris docs, this warning is harmless. The SunCC compiler has a "smart" template-compilation model which allows you to only DECLARE template classes in X.h, and the compiler will automatically look for definitions in X.cc. If X.cc does not exist, it emits the warning.
Sorry, thats new to me. It does not happen anywhere else with my own templates. Also I'm not completely sure this is really harmless. My code works with 1.32.0 (+ Solaris patches) and with 1.34.0 [assign] list_of does not work any more. The two warnings are the only thing the compiler complains about. My wild (stupid??) guess was, this is related. I will debug the problem in detail and post my results.
This "searching" process is fully described in the manual. I get it even on some of my own code, but it works when run.
Look at sections 7.5 and 5.2 in the following links: http://docs.sun.com/source/819-3690/Compiling_Templates.html http://docs.sun.com/source/819-3690/Program_Org.html#24618
It seems that the option -template=no%extdef should help (-template=extdef is the default).
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

Zeljko Vrba wrote:
The SunCC compiler has a "smart" template-compilation model which allows you to only DECLARE template classes in X.h, and the compiler will automatically look for definitions in X.cc. If X.cc does not exist, it emits the warning.
With EDG-based compilers, it is called "implicit inclusion". Boris ----- Original Message ----- From: "Zeljko Vrba" <zvrba@ifi.uio.no> To: <boost-users@lists.boost.org> Sent: Wednesday, June 06, 2007 2:21 AM Subject: Re: [Boost-users] [function] Bug in 1.34.0 with Sun Studio onSolaris
On Wed, Jun 06, 2007 at 02:46:14AM +0200, Markus Bernhardt wrote:
I get the following warnings when using a boost::thread_specific_ptr<unsigned int> and compiling with Sun Studio 11 (with latest patches) or Sun Studio 12 on Solaris x86.
Warning: Could not find source for boost::type_traits::ice_not<0>::value.
As far as I understood from the Solaris docs, this warning is harmless. The SunCC compiler has a "smart" template-compilation model which allows you to only DECLARE template classes in X.h, and the compiler will automatically look for definitions in X.cc. If X.cc does not exist, it emits the warning.
This "searching" process is fully described in the manual. I get it even on some of my own code, but it works when run.
Look at sections 7.5 and 5.2 in the following links: http://docs.sun.com/source/819-3690/Compiling_Templates.html http://docs.sun.com/source/819-3690/Program_Org.html#24618
It seems that the option -template=no%extdef should help (-template=extdef is the default).
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

Markus Bernhardt wrote:
Hi,
I get the following warnings when using a boost::thread_specific_ptr<unsigned int> and compiling with Sun Studio 11 (with latest patches) or Sun Studio 12 on Solaris x86.
Warning: Could not find source for boost::type_traits::ice_not<0>::value. "../../../build/debug/include/boost/function/function_template.hpp", line 407: Warning: Could not find source for boost::detail::function::function_allows_small_object_optimization<boost::detail::tss_adapter<unsigned>>::value.
My guess is that this warning is caused by BOOST_STATIC_CONSTANT that has no corresponding out of line definition.
A similar warning is reported when I use boost::bind.
I'm interested in details. What warnings do you get from boost::bind?
participants (4)
-
Boris Gubenko
-
Markus Bernhardt
-
Peter Dimov
-
Zeljko Vrba