Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Mar 2016 09:02:44 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-standards@FreeBSD.org
Subject:   [Bug 207918] C++ ostream operator << broken for unsigned long long when using showbase with octal format
Message-ID:  <bug-207918-15-vN1vcdhht9@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-207918-15@https.bugs.freebsd.org/bugzilla/>
References:  <bug-207918-15@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D207918

Mahdi Mokhtari <mokhi64@gmail.com> changed:

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

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

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

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

<code>

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

</code>


regards, Mokhi.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-207918-15-vN1vcdhht9>