Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#244 please cast _DEFAULT_SIZE to size_type

5.2
open
nobody
5
2010-11-04
2010-11-04
Maxim Yanchenko
No

GCC 3.4.6 issues the following annoying warning while compiling with STLPort 5.2.1:
stlport/stl/_string_base.h:72: warning: enumeral and non-enumeral type in conditional expression

here is the function:
size_type _M_capacity() const
{ return _M_using_static_buf() ? _DEFAULT_SIZE : _M_buffers._M_end_of_storage - _M_start_of_storage._M_data; }

if you change _DEFAULT_SIZE to (size_type)_DEFAULT_SIZE, it shuts GCC up.
Looks like this is the only place.

Thanks,
Maxim

Discussion

    • labels: --> 771356
    • milestone: --> 5.2
     
    • labels: 771356 --> General code