Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 88460 invoked from network); 10 Aug 2007 16:37:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Aug 2007 16:37:33 -0000 Received: (qmail 82873 invoked by uid 500); 10 Aug 2007 16:37:31 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 82858 invoked by uid 500); 10 Aug 2007 16:37:31 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 82847 invoked by uid 99); 10 Aug 2007 16:37:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Aug 2007 09:37:31 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [208.30.140.160] (HELO moroha.quovadx.com) (208.30.140.160) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Aug 2007 16:37:28 +0000 Received: from qxvcexch01.ad.quovadx.com ([192.168.170.59]) by moroha.quovadx.com (8.13.6/8.13.6) with ESMTP id l7AGb6UA009293 for ; Fri, 10 Aug 2007 16:37:06 GMT Received: from [10.70.3.113] ([10.70.3.113]) by qxvcexch01.ad.quovadx.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 10 Aug 2007 10:36:25 -0600 Message-ID: <46BC9454.3060704@roguewave.com> Date: Fri, 10 Aug 2007 10:37:40 -0600 From: Martin Sebor Organization: Rogue Wave Software, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2) Gecko/20070221 SeaMonkey/1.1.1 MIME-Version: 1.0 To: stdcxx-dev@incubator.apache.org Subject: Re: svn commit: r564059 - in /incubator/stdcxx/trunk: include/limits src/limits_bits.cpp References: <20070809004755.6FA4C1A981A@eris.apache.org> <46BC8F9A.3050609@roguewave.com> In-Reply-To: <46BC8F9A.3050609@roguewave.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 10 Aug 2007 16:36:25.0187 (UTC) FILETIME=[97BA5330:01C7DB6C] X-Virus-Checked: Checked by ClamAV on apache.org Andrew Black wrote: > Greetings Martin > > I'm not completely certain, but I believe this change is leading to > failures on most or all operating systems. In particular, linker > warnings of Drat! The patch is incomplete. I forgot to commit a change to another library file that forward declares the symbol. This should fix it: http://svn.apache.org/viewvc?view=rev&rev=564664 Thanks for letting me know! Martin >> ld: (Warning) Unsatisfied symbol "__rw::__rw_flt_infinity" in file $(BUILDDIR)/lib/libstd.sl >> ld: (Warning) Unsatisfied symbol "__rw::__rw_dbl_infinity" in file $(BUILDDIR)/lib/libstd.sl >> ld: (Warning) Unsatisfied symbol "__rw::__rw_ldbl_infinity" in file $(BUILDDIR)/lib/libstd.sl > are observed in static builds (on HPUX), and the same message is > observed when running the exec utility in dynamic builds. > > --Andrew Black > > sebor@apache.org wrote: >> Author: sebor >> Date: Wed Aug 8 17:47:54 2007 >> New Revision: 564059 >> >> URL: http://svn.apache.org/viewvc?view=rev&rev=564059 >> Log: >> 2007-08-09 Martin Sebor >> >> STDCXX-509 >> * limits (__rw_flt_denorm_min, __rw_flt_infinity, __rw_flt_qNaN, >> __rw_flt_sNaN, __rw_dbl_denorm_min, __rw_dbl_infinity, __rw_dbl_qNaN, >> __rw_dbl_sNaN, __rw_ldbl_denorm_min, __rw_ldbl_infinity, __rw_ldbl_qNaN, >> __rw_ldbl_sNaN): Declared floating point constants with "C" language >> linkage to prevent "clever" compilers such as MSVC from mangling their >> type into their names and to permit them to be defined with different >> types. >> * limits_bits.cpp (__rw_flt_denorm_min, __rw_flt_infinity, >> __rw_flt_qNaN, __rw_flt_sNaN, __rw_dbl_denorm_min, __rw_dbl_infinity, >> __rw_dbl_qNaN, __rw_dbl_sNaN, __rw_ldbl_denorm_min, __rw_ldbl_infinity, >> __rw_ldbl_qNaN, __rw_ldbl_sNaN): Defined as statically (i.e., at load >> time as opposed to dynamically, at runtime) initialized unions, backed >> by the appropriate byte patterns, with "C" language linkage to permit >> the defintions to have a different type than the declarations. >> (__rw_flt_denorm_min_bits, __rw_flt_infinity_bits, __rw_flt_qNaN_bits, >> __rw_flt_sNaN_bits, __rw_dbl_denorm_min_bits, __rw_dbl_infinity_bits, >> __rw_dbl_qNaN_bits, __rw_dbl_sNaN_bits, __rw_ldbl_denorm_min_bits, >> __rw_ldbl_infinity_bits, __rw_ldbl_qNaN_bits, __rw_ldbl_sNaN_bits): >> Removed. >> >> Modified: >> incubator/stdcxx/trunk/include/limits >> incubator/stdcxx/trunk/src/limits_bits.cpp >> >> Modified: incubator/stdcxx/trunk/include/limits >> URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/include/limits?view=diff&rev=564059&r1=564058&r2=564059 >> ============================================================================== >> --- incubator/stdcxx/trunk/include/limits (original) >> +++ incubator/stdcxx/trunk/include/limits Wed Aug 8 17:47:54 2007 >> @@ -23,7 +23,7 @@ >> * implied. See the License for the specific language governing >> * permissions and limitations under the License. >> * >> - * Copyright 1994-2006 Rogue Wave Software. >> + * Copyright 1994-2007 Rogue Wave Software, Inc. >> * >> **************************************************************************/ >> >> @@ -86,7 +86,9 @@ >> #endif // _RWSTD_IS_IEC559 >> >> >> -_RWSTD_NAMESPACE (__rw) { >> +_RWSTD_NAMESPACE (__rw) { >> + >> +extern "C" { >> >> _RWSTD_EXPORT extern const float __rw_flt_infinity; >> _RWSTD_EXPORT extern const double __rw_dbl_infinity; >> @@ -108,6 +110,8 @@ >> _RWSTD_EXPORT extern const long double __rw_ldbl_denorm_min; >> >> #endif // _RWSTD_NO_LONG_DOUBLE >> + >> +} // extern "C" >> >> } // namespace __rw >> >> >> Modified: incubator/stdcxx/trunk/src/limits_bits.cpp >> URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/src/limits_bits.cpp?view=diff&rev=564059&r1=564058&r2=564059 >> ============================================================================== >> --- incubator/stdcxx/trunk/src/limits_bits.cpp (original) >> +++ incubator/stdcxx/trunk/src/limits_bits.cpp Wed Aug 8 17:47:54 2007 >> @@ -22,7 +22,7 @@ >> * implied. See the License for the specific language governing >> * permissions and limitations under the License. >> * >> - * Copyright 1994-2006 Rogue Wave Software. >> + * Copyright 1994-2007 Rogue Wave Software, Inc. >> * >> **************************************************************************/ >> >> @@ -30,6 +30,11 @@ >> >> #include // for INFINITY, NAN >> #include // for atof() >> + >> +// must not #include to avoid colliding with symbols >> +// declared there with a different type than what they are >> +// defined with here >> +// #include >> >> #include >> >> @@ -42,126 +47,106 @@ >> # error one of _RWSTD_NO_INFINITY and _RWSTD_DBL_INF_BITS must be #defined >> # endif >> >> -// infinity computed at config time >> -static const union { >> - char _C_bits [sizeof (double)]; >> - double _C_val; >> -} __rw_dbl_inf_bits = { _RWSTD_DBL_INF_BITS }; >> >> -_RWSTD_EXPORT extern const double __rw_dbl_infinity = __rw_dbl_inf_bits._C_val; >> - >> -static const union { >> - char _C_bits [sizeof (float)]; >> +union _FltBits { >> + char _C_bits [sizeof (float)]; >> float _C_val; >> -} __rw_flt_inf_bits = { _RWSTD_FLT_INF_BITS }; >> +}; >> >> -_RWSTD_EXPORT extern const float __rw_flt_infinity = __rw_flt_inf_bits._C_val; >> + >> +union _DblBits { >> + char _C_bits [sizeof (double)]; >> + double _C_val; >> +}; >> >> >> # ifndef _RWSTD_NO_LONG_DOUBLE >> >> -static const union { >> - char _C_bits [sizeof (long double)]; >> +union _LDblBits { >> + char _C_bits [sizeof (long double)]; >> long double _C_val; >> -} __rw_ldbl_inf_bits = { _RWSTD_LDBL_INF_BITS }; >> +}; >> + >> +# endif // _RWSTD_NO_LONG_DOUBLE >> + >> +extern "C" { >> + >> +// The constants below are declared in but with a different >> +// type. C linkage is used to defeat MSVC and other "clever" compilers >> +// that mangle the type of objects into their names. >> + >> +// infinity computed at config time >> +_RWSTD_EXPORT extern const _DblBits >> +__rw_dbl_infinity = { _RWSTD_DBL_INF_BITS }; >> + >> + >> +_RWSTD_EXPORT extern const _FltBits >> +__rw_flt_infinity = { _RWSTD_FLT_INF_BITS }; >> + >> + >> +# ifndef _RWSTD_NO_LONG_DOUBLE >> >> +_RWSTD_EXPORT extern const _LDblBits >> +__rw_ldbl_infinity = { _RWSTD_LDBL_INF_BITS }; >> >> -_RWSTD_EXPORT extern const long double >> -__rw_ldbl_infinity = __rw_ldbl_inf_bits._C_val; >> >> # endif // _RWSTD_NO_LONG_DOUBLE >> >> >> // quiet NaN computed at config time >> -static const union { >> - char _C_bits [sizeof (double)]; >> - double _C_val; >> -} __rw_dbl_qNaN_bits = { _RWSTD_DBL_QNAN_BITS }; >> - >> -_RWSTD_EXPORT extern const double __rw_dbl_qNaN = __rw_dbl_qNaN_bits._C_val; >> +_RWSTD_EXPORT extern const _DblBits >> +__rw_dbl_qNaN = { _RWSTD_DBL_QNAN_BITS }; >> >> -static const union { >> - char _C_bits [sizeof (float)]; >> - float _C_val; >> -} __rw_flt_qNaN_bits = { _RWSTD_FLT_QNAN_BITS }; >> >> -_RWSTD_EXPORT extern const float __rw_flt_qNaN = __rw_flt_qNaN_bits._C_val; >> +_RWSTD_EXPORT extern const _FltBits >> +__rw_flt_qNaN = { _RWSTD_FLT_QNAN_BITS }; >> >> >> # ifndef _RWSTD_NO_LONG_DOUBLE >> >> -static const union { >> - char _C_bits [sizeof (long double)]; >> - long double _C_val; >> -} __rw_ldbl_qNaN_bits = { _RWSTD_LDBL_QNAN_BITS }; >> - >> +_RWSTD_EXPORT extern const _LDblBits >> +__rw_ldbl_qNaN = { _RWSTD_LDBL_QNAN_BITS }; >> >> -_RWSTD_EXPORT extern const long double >> -__rw_ldbl_qNaN = __rw_ldbl_qNaN_bits._C_val; >> >> # endif // _RWSTD_NO_LONG_DOUBLE >> >> >> // signaling NaN computed at config time >> -static const union { >> - char _C_bits [sizeof (double)]; >> - double _C_val; >> -} __rw_dbl_sNaN_bits = { _RWSTD_DBL_SNAN_BITS }; >> +_RWSTD_EXPORT extern const _DblBits >> +__rw_dbl_sNaN = { _RWSTD_DBL_SNAN_BITS }; >> >> -_RWSTD_EXPORT extern const double __rw_dbl_sNaN = __rw_dbl_sNaN_bits._C_val; >> - >> -static const union { >> - char _C_bits [sizeof (float)]; >> - float _C_val; >> -} __rw_flt_sNaN_bits = { _RWSTD_FLT_SNAN_BITS }; >> >> -_RWSTD_EXPORT extern const float __rw_flt_sNaN = __rw_flt_sNaN_bits._C_val; >> +_RWSTD_EXPORT extern const _FltBits >> +__rw_flt_sNaN = { _RWSTD_FLT_SNAN_BITS }; >> >> >> # ifndef _RWSTD_NO_LONG_DOUBLE >> >> -static const union { >> - char _C_bits [sizeof (long double)]; >> - long double _C_val; >> -} __rw_ldbl_sNaN_bits = { _RWSTD_LDBL_SNAN_BITS }; >> - >> +_RWSTD_EXPORT extern const _LDblBits >> +__rw_ldbl_sNaN = { _RWSTD_LDBL_SNAN_BITS }; >> >> -_RWSTD_EXPORT extern const long double >> -__rw_ldbl_sNaN = __rw_ldbl_sNaN_bits._C_val; >> >> # endif // _RWSTD_NO_LONG_DOUBLE >> >> >> // denormalized minima computed at config time >> -static const union { >> - char _C_bits [sizeof (double)]; >> - double _C_val; >> -} __rw_dbl_denorm_min_bits = { _RWSTD_DBL_DENORM_MIN_BITS }; >> - >> -_RWSTD_EXPORT extern const double >> -__rw_dbl_denorm_min = __rw_dbl_denorm_min_bits._C_val; >> +_RWSTD_EXPORT extern const _DblBits >> +__rw_dbl_denorm_min = { _RWSTD_DBL_DENORM_MIN_BITS }; >> >> -static const union { >> - char _C_bits [sizeof (float)]; >> - float _C_val; >> -} __rw_flt_denorm_min_bits = { _RWSTD_FLT_DENORM_MIN_BITS }; >> >> -_RWSTD_EXPORT extern const float >> -__rw_flt_denorm_min = __rw_flt_denorm_min_bits._C_val; >> +_RWSTD_EXPORT extern const _FltBits >> +__rw_flt_denorm_min = { _RWSTD_FLT_DENORM_MIN_BITS }; >> >> >> # ifndef _RWSTD_NO_LONG_DOUBLE >> >> -static const union { >> - char _C_bits [sizeof (long double)]; >> - long double _C_val; >> -} __rw_ldbl_denorm_min_bits = { _RWSTD_LDBL_DENORM_MIN_BITS }; >> - >> +_RWSTD_EXPORT extern const _LDblBits >> +__rw_ldbl_denorm_min = { _RWSTD_LDBL_DENORM_MIN_BITS }; >> >> -_RWSTD_EXPORT extern const long double >> -__rw_ldbl_denorm_min = __rw_ldbl_denorm_min_bits._C_val; >> >> # endif // _RWSTD_NO_LONG_DOUBLE >> + >> +} // extern "C" >> >> #else // if defined (_RWSTD_NO_INFINITY) >> >> >> >>