You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Martin Sebor <se...@roguewave.com> on 2008/03/18 16:31:25 UTC

Re: svn commit: r638382 - in /stdcxx/trunk: include/fstream include/istream src/podarray.h

faridz@apache.org wrote:
> Author: faridz
> Date: Tue Mar 18 07:22:15 2008
> New Revision: 638382

Just out of curiosity: are these warnings new in MSVC 9? (I don't
think they show up in MSVC 8 builds.)

Martin

> 
> URL: http://svn.apache.org/viewvc?rev=638382&view=rev
> Log:
> 2008-03-18  Farid Zaripov  <fa...@epam.com>
> 
> 	STDCXX-648
> 	* include/fstream: Change 'class' keyword to 'struct' to hide MSVC warning C4099:
> 	'std::ios_base::Init' : type name first seen using 'struct' now seen using 'class'.
> 	* include/istream [_RWSTD_NO_EXT_NUM_GET] (__rw_extract(istream&, short &)):
> 	New overload, implemented thus__rw_extract<long>.
> 	[_RWSTD_NO_EXT_NUM_GET] (__rw_extract(istream&, int &)):
> 	New overload, implemented thus__rw_extract<long>.
> 	* src/podarray.h (_C_length): Use inplace algorithm instead of
> 	char_traits::length when _RWSTD_NO_EXT_CHAR_TRAITS_PRIMARY macro is #defined.
> 
> Modified:
>     stdcxx/trunk/include/fstream
>     stdcxx/trunk/include/istream
>     stdcxx/trunk/src/podarray.h
> 
> Modified: stdcxx/trunk/include/fstream
> URL: http://svn.apache.org/viewvc/stdcxx/trunk/include/fstream?rev=638382&r1=638381&r2=638382&view=diff
> ==============================================================================
> --- stdcxx/trunk/include/fstream (original)
> +++ stdcxx/trunk/include/fstream Tue Mar 18 07:22:15 2008
> @@ -121,7 +121,7 @@
>  private:
>  
>      // g++ 2.95 error: `std::ios_base::Init' does not declare a template type
> -    friend class ios_base::Init;
> +    friend struct ios_base::Init;
>  
>  #endif   // _RWSTD_NO_EXT_FILEBUF && !_RWSTD_NO_STATIC_IOSTREAM_INIT
>  
> 
> Modified: stdcxx/trunk/include/istream
> URL: http://svn.apache.org/viewvc/stdcxx/trunk/include/istream?rev=638382&r1=638381&r2=638382&view=diff
> ==============================================================================
> --- stdcxx/trunk/include/istream (original)
> +++ stdcxx/trunk/include/istream Tue Mar 18 07:22:15 2008
> @@ -55,6 +55,45 @@
>  _STD::basic_istream<_CharT, _Traits>&
>  __rw_extract (_STD::basic_istream<_CharT, _Traits>&, _NativeType&);
>  
> +
> +#ifdef _RWSTD_NO_EXT_NUM_GET
> +
> +template <class _CharT, class _Traits>
> +inline _STD::basic_istream<_CharT, _Traits>&
> +__rw_extract (_STD::basic_istream<_CharT, _Traits> &__strm,
> +              short                                &__val)
> +{
> +    long __tmp = __val;
> +    __rw_extract (__strm, __tmp);
> +
> +    _STD::ios_base::iostate __err = _STD::ios_base::goodbit;
> +    __val = __rw_check_overflow_short (__tmp, __strm.flags (), __err);
> +
> +    if (_STD::ios_base::goodbit != __err)
> +        __strm.setstate (__err);
> +
> +    return __strm;
> +}
> +
> +template <class _CharT, class _Traits>
> +inline _STD::basic_istream<_CharT, _Traits>&
> +__rw_extract (_STD::basic_istream<_CharT, _Traits> &__strm,
> +              int                                  &__val)
> +{
> +    long __tmp = __val;
> +    __rw_extract (__strm, __tmp);
> +
> +    _STD::ios_base::iostate __err = _STD::ios_base::goodbit;
> +    __val = __rw_check_overflow_int (__tmp, __strm.flags (), __err);
> +
> +    if (_STD::ios_base::goodbit != __err)
> +        __strm.setstate (__err);
> +
> +    return __strm;
> +}
> +
> +#endif   // _RWSTD_NO_EXT_NUM_GET
> +
>  }   // namespace __rw
>  
>  
> 
> Modified: stdcxx/trunk/src/podarray.h
> URL: http://svn.apache.org/viewvc/stdcxx/trunk/src/podarray.h?rev=638382&r1=638381&r2=638382&view=diff
> ==============================================================================
> --- stdcxx/trunk/src/podarray.h (original)
> +++ stdcxx/trunk/src/podarray.h Tue Mar 18 07:22:15 2008
> @@ -198,7 +198,13 @@
>  private:
>  
>      static _RWSTD_SIZE_T _C_length (const _TypeT *__a) {
> +#ifndef _RWSTD_NO_EXT_CHAR_TRAITS_PRIMARY
>          return _STD::char_traits<_TypeT>::length (__a);
> +#else    // #ifdef _RWSTD_NO_EXT_CHAR_TRAITS_PRIMARY
> +        _RWSTD_SIZE_T __len = 0;
> +        for (; _TypeT () != *__a; ++__a, ++__len) ;
> +        return __len;
> +#endif   // _RWSTD_NO_EXT_CHAR_TRAITS_PRIMARY
>      }
>  };
>  
> 
> 
> 


Re: svn commit: r638382 - in /stdcxx/trunk: include/fstream include/istream src/podarray.h

Posted by Martin Sebor <se...@roguewave.com>.
Farid Zaripov wrote:
>> -----Original Message-----
>> From: Martin Sebor [mailto:msebor@gmail.com] On Behalf Of Martin Sebor
>> Sent: Tuesday, March 18, 2008 6:08 PM
>> To: dev@stdcxx.apache.org
>> Subject: Re: svn commit: r638382 - in /stdcxx/trunk: 
>> include/fstream include/istream src/podarray.h
>>
>>>   Note: this warning issued on MSVC in strict mode only (when 
>>> _RWSTD_STRICT_ANSI macro defined).
>> Ah! That's why it's not showing up in our nightly builds. Do 
>> you think it would be useful to schedule some strict mode builds?
> 
>   Perhaps testing once per week would be useful and enough.
> By the way there 3 examples along with rwtest library fails to compile
> in strict mode.

Just create issues for them.

Let me see what can be done about the strict builds.

Martin


RE: svn commit: r638382 - in /stdcxx/trunk: include/fstream include/istream src/podarray.h

Posted by Farid Zaripov <Fa...@epam.com>.
> -----Original Message-----
> From: Martin Sebor [mailto:msebor@gmail.com] On Behalf Of Martin Sebor
> Sent: Tuesday, March 18, 2008 6:08 PM
> To: dev@stdcxx.apache.org
> Subject: Re: svn commit: r638382 - in /stdcxx/trunk: 
> include/fstream include/istream src/podarray.h
> 
> >   Note: this warning issued on MSVC in strict mode only (when 
> > _RWSTD_STRICT_ANSI macro defined).
> 
> Ah! That's why it's not showing up in our nightly builds. Do 
> you think it would be useful to schedule some strict mode builds?

  Perhaps testing once per week would be useful and enough.
By the way there 3 examples along with rwtest library fails to compile
in strict mode.

Farid.

Re: svn commit: r638382 - in /stdcxx/trunk: include/fstream include/istream src/podarray.h

Posted by Martin Sebor <se...@roguewave.com>.
Farid Zaripov wrote:
>> -----Original Message-----
>> From: Martin Sebor [mailto:msebor@gmail.com] On Behalf Of Martin Sebor
>> Sent: Tuesday, March 18, 2008 5:31 PM
>> To: dev@stdcxx.apache.org
>> Subject: Re: svn commit: r638382 - in /stdcxx/trunk: 
>> include/fstream include/istream src/podarray.h
>>
>> faridz@apache.org wrote:
>>> Author: faridz
>>> Date: Tue Mar 18 07:22:15 2008
>>> New Revision: 638382
>> Just out of curiosity: are these warnings new in MSVC 9? (I 
>> don't think they show up in MSVC 8 builds.)
> 
>   I saw this warning when compiled the library with MSVC 7.1.
> Just now compiled with MSVC 8.0 and 9.0 and this warning still
> present in both compilers.
> 
>   Note: this warning issued on MSVC in strict mode only (when
> _RWSTD_STRICT_ANSI macro defined).

Ah! That's why it's not showing up in our nightly builds. Do you
think it would be useful to schedule some strict mode builds?

Martin


RE: svn commit: r638382 - in /stdcxx/trunk: include/fstream include/istream src/podarray.h

Posted by Farid Zaripov <Fa...@epam.com>.
> -----Original Message-----
> From: Martin Sebor [mailto:msebor@gmail.com] On Behalf Of Martin Sebor
> Sent: Tuesday, March 18, 2008 5:31 PM
> To: dev@stdcxx.apache.org
> Subject: Re: svn commit: r638382 - in /stdcxx/trunk: 
> include/fstream include/istream src/podarray.h
> 
> faridz@apache.org wrote:
> > Author: faridz
> > Date: Tue Mar 18 07:22:15 2008
> > New Revision: 638382
> 
> Just out of curiosity: are these warnings new in MSVC 9? (I 
> don't think they show up in MSVC 8 builds.)

  I saw this warning when compiled the library with MSVC 7.1.
Just now compiled with MSVC 8.0 and 9.0 and this warning still
present in both compilers.

  Note: this warning issued on MSVC in strict mode only (when
_RWSTD_STRICT_ANSI macro defined).

Farid.