Travis Vitek wrote:
Well, I got a chance to build stdcxx [trunk] on a few platforms today. Things went pretty smoothly with the exception of a few simple errors in valarray that cause test 'intro/17.names.cpp' to not compile. The problem is that the local variable names 'msk', 'sec' and 'sl' are bad names [as defined by the test itself]. I've pasted the error text below I noticed that we're using the more appropriate '__<name>' in a most places, so I made this same change and pasted a patch below.
Thanks Travis! The 17.names test has been failing for some time and I'm to blame for both introducing the failures by tightening up the test (adding the new names) and not privatizing them in valarray soon enough. I rewrote valarray to fix the many bugs we have open for it (http://tinyurl.com/yv2c75) but I still haven't checked it in, mainly because I haven't sufficiently tested the changes. I still plan to commit the rewrite before 4.2.0 is released but I think we might as well commit your patch in the meantime and get the test to compile. Unfortunately, I think the patch got mangled in transit and it doesn't apply cleanly. Can you resend it as an attachment? (If that doesn't work -- the list sometimes strips attachments sent by certain mailers -- it might be best to open a new issue in Jira and attach the patch to it). Martin
Travis In file included from /amd/devco/vitek/stdcxx/trunk/tests/intro/17.names.cpp:660: /amd/devco/vitek/stdcxx/trunk/include/valarray: In constructor `std::valarray<_TypeT>::valarray(const std::gslice_array<_TypeT>&)': /amd/devco/vitek/stdcxx/trunk/include/valarray:2144: error: expected unqualified-id before '!' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2147: error: `ERROR' was not declared in this scope /amd/devco/vitek/stdcxx/trunk/include/valarray:2149: error: expected `,' or `;' before '!' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2152: error: expected `)' before '!' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2152: error: expected primary-expression before '.' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2152: error: expected `;' before ')' token /amd/devco/vitek/stdcxx/trunk/include/valarray: In member function `std::valarray<_TypeT>& std::valarray<_TypeT>::operator=(const std::gslice_array<_TypeT>&)': /amd/devco/vitek/stdcxx/trunk/include/valarray:2167: error: expected unqualified-id before '!' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2170: error: `ERROR' was not declared in this scope /amd/devco/vitek/stdcxx/trunk/include/valarray:2172: error: expected `,' or `;' before '!' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2175: error: expected `)' before '!' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2175: error: expected primary-expression before '.' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2175: error: expected `;' before ')' token /amd/devco/vitek/stdcxx/trunk/include/valarray: In constructor `std::valarray<_TypeT>::valarray(const std::mask_array<_TypeT>&)': /amd/devco/vitek/stdcxx/trunk/include/valarray:2215: error: expected unqualified-id before '!' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2215: error: expected initializer before '!' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2216: error: expected unqualified-id before '!' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2216: error: expected initializer before '!' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2220: error: `ERROR' was not declared in this scope /amd/devco/vitek/stdcxx/trunk/include/valarray:2220: error: expected `;' before '!' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2220: error: expected primary-expression before '->' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2220: error: expected `)' before ';' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2220: error: expected `;' before ')' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2227: error: `ERROR' was not declared in this scope /amd/devco/vitek/stdcxx/trunk/include/valarray:2227: error: expected `;' before '!' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2227: error: expected primary-expression before '->' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2227: error: expected `)' before ';' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2227: error: expected `;' before ')' token /amd/devco/vitek/stdcxx/trunk/include/valarray: In member function `std::valarray<_TypeT>& std::valarray<_TypeT>::operator=(const std::mask_array<_TypeT>&)': /amd/devco/vitek/stdcxx/trunk/include/valarray:2238: error: expected unqualified-id before '!' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2238: error: expected initializer before '!' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2239: error: expected unqualified-id before '!' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2239: error: expected initializer before '!' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2243: error: `ERROR' was not declared in this scope /amd/devco/vitek/stdcxx/trunk/include/valarray:2243: error: expected `;' before '!' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2243: error: expected primary-expression before '->' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2243: error: expected `)' before ';' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2243: error: expected `;' before ')' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2251: error: `ERROR' was not declared in this scope /amd/devco/vitek/stdcxx/trunk/include/valarray:2251: error: expected `;' before '!' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2251: error: expected primary-expression before '->' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2251: error: expected `)' before ';' token /amd/devco/vitek/stdcxx/trunk/include/valarray:2251: error: expected `;' before ')' token gmake[2]: *** [17.names.o] Error 1 gmake[2]: Leaving directory `/amd/devbuild/vitek/stdcxx/trunk/tests' gmake[1]: [tests] Error 2 (ignored) gmake[1]: Leaving directory `/amd/devbuild/vitek/stdcxx/trunk' 2007-07-24 Travis Vitek <[EMAIL PROTECTED]> * valarray: Updated local variable names to meet conventions and get test 17.names passing again Index: /amd/devco/vitek/stdcxx/trunk/include/valarray =================================================================== --- /amd/devco/vitek/stdcxx/trunk/include/valarray (revision 558901) +++ /amd/devco/vitek/stdcxx/trunk/include/valarray (working copy) @@ -38,7 +38,6 @@ #include <rw/_defs.h> #include _RWSTD_CMATH - #ifdef _MSC_VER # pragma warning (push) // disable conversion from 'double' to 'float', possible loss of data @@ -2141,18 +2140,18 @@ template <class _TypeT> inline valarray<_TypeT>::valarray(const gslice_array<_TypeT>& sl_ar) { - gslice sl(sl_ar._C_get_slice()); + gslice __sl(sl_ar._C_get_slice()); _RW::__rw_array <_TypeT> __tmp = - _RW::__rw_array <_TypeT>(_TypeT (), sl.ind_numb()); + _RW::__rw_array <_TypeT>(_TypeT (), __sl.ind_numb()); - _RWSTD_SIZE_T __i = sl.next_ind(); + _RWSTD_SIZE_T __i = __sl.next_ind(); _RWSTD_SIZE_T __cpt = 0; - while( !sl.is_reseted() ) + while( !__sl.is_reseted() ) { __tmp[__cpt] = (*(sl_ar.get_ref_mem_array()))[__i]; - __i= sl.next_ind(); + __i= __sl.next_ind(); __cpt++; } @@ -2164,18 +2163,18 @@ inline valarray<_TypeT>& valarray<_TypeT>::operator= (const gslice_array<_TypeT>& sl_ar) { - gslice sl(sl_ar._C_get_slice()); + gslice __sl(sl_ar._C_get_slice()); _RW::__rw_array <_TypeT> __tmp = - _RW::__rw_array <_TypeT>(_TypeT (), sl.ind_numb()); + _RW::__rw_array <_TypeT>(_TypeT (), __sl.ind_numb()); - _RWSTD_SIZE_T __i = sl.next_ind(); + _RWSTD_SIZE_T __i = __sl.next_ind(); _RWSTD_SIZE_T __cpt = 0; - while( !sl.is_reseted() ) + while( !__sl.is_reseted() ) { __tmp[__cpt] = (*(sl_ar.get_ref_mem_array()))[__i]; - __i= sl.next_ind(); + __i= __sl.next_ind(); __cpt++; } @@ -2211,21 +2210,20 @@ template <class _TypeT> inline valarray<_TypeT>::valarray(const mask_array<_TypeT>& __rhs) { + mask_array<_TypeT> *__msk = _RWSTD_CONST_CAST (mask_array<_TypeT>*, &__rhs); + const valarray<bool>*__sec = __msk->_C_get_array_ptr(); - mask_array<_TypeT> *msk = _RWSTD_CONST_CAST (mask_array<_TypeT>*, &__rhs); - const valarray<bool>*sec = msk->_C_get_array_ptr(); - _RWSTD_SIZE_T __i, __n = 0; - for(__i = 0; __i < sec->size(); __i++) - if ( (*sec)[__i]) __n++; + for(__i = 0; __i < __sec->size(); __i++) + if ( (*__sec)[__i]) __n++; _RW::__rw_array <_TypeT> __tmp = _RW::__rw_array <_TypeT>(_TypeT (), __n); _RWSTD_SIZE_T __cpt = 0; - for( __i=0; __i < sec->size(); __i++ ) - if ( (*sec)[__i]) __tmp[__cpt++] = (*(__rhs.get_ref_mem_array()))[__i]; + for( __i=0; __i < __sec->size(); __i++ ) + if ( (*__sec)[__i]) __tmp[__cpt++] = (*(__rhs.get_ref_mem_array()))[__i]; _C_array.swap (__tmp); } @@ -2235,21 +2233,21 @@ inline valarray<_TypeT>& valarray<_TypeT>::operator= (const mask_array<_TypeT>& __rhs) { - mask_array<_TypeT> *msk = _RWSTD_CONST_CAST (mask_array<_TypeT>*, &__rhs); - const valarray<bool>*sec = msk->_C_get_array_ptr(); + mask_array<_TypeT> *__msk = _RWSTD_CONST_CAST (mask_array<_TypeT>*, &__rhs); + const valarray<bool>*__sec = __msk->_C_get_array_ptr(); _RWSTD_SIZE_T __i, __n = 0; - for (__i = 0; __i < sec->size(); __i++) - if ((*sec)[__i]) + for (__i = 0; __i < __sec->size(); __i++) + if ((*__sec)[__i]) __n++; _RW::__rw_array <_TypeT> __tmp = _RW::__rw_array <_TypeT>(_TypeT (), __n); _RWSTD_SIZE_T __cpt = 0; - for( __i=0; __i < sec->size(); __i++ ) - if ( (*sec)[__i]) __tmp[__cpt++] = (*(__rhs.get_ref_mem_array()))[__i]; + for( __i=0; __i < __sec->size(); __i++ ) + if ( (*__sec)[__i]) __tmp[__cpt++] = (*(__rhs.get_ref_mem_array()))[__i]; if ( &_C_array == __rhs.get_ref_mem_array() ) _C_array.resize(0);