[Bug 207918] C++ ostream operator << broken for unsigned long long when using showbase with octal format

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Mar 12 09:02:45 UTC 2016


Mahdi Mokhtari <mokhi64 at gmail.com> changed:

           What    |Removed                     |Added
             Status|New                         |In Progress
                 CC|                            |mokhi64 at gmail.com

--- Comment #1 from Mahdi Mokhtari <mokhi64 at gmail.com> ---
I've checked this.
I figured out it happens for all ::max() ones, seems because of 

This could be changed easily, though i think we should see which is the better
(standard) behavior (use fill in all cases or exclude showbase case) ?

this is the code i talking based on(contrib/libc++/include/ostream):


template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(unsigned long long __n)
        sentry __s(*this);
        if (__s)
            typedef num_put<char_type, ostreambuf_iterator<char_type,
traits_type> > _Fp;
            const _Fp& __f = use_facet<_Fp>(this->getloc());
            if (__f.put(*this, *this, this->fill(), __n).failed())
                this->setstate(ios_base::badbit | ios_base::failbit);
    catch (...)
    return *this;


regards, Mokhi.

You are receiving this mail because:
You are on the CC list for the bug.

More information about the freebsd-amd64 mailing list