[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 08:27:14 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207918

            Bug ID: 207918
           Summary: C++ ostream operator << broken for unsigned long long
                    when using showbase with octal format
           Product: Base System
           Version: 10.3-BETA2
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: standards
          Assignee: freebsd-standards at FreeBSD.org
          Reporter: dwmcrobb at me.com
                CC: freebsd-amd64 at FreeBSD.org
                CC: freebsd-amd64 at FreeBSD.org

C++ library issue.

Using showbase with ostreams causes truncation of unsigned long long when
output format is octal.

#include <iostream>
#include <iomanip>

int main(int argc, char *argv[])
{
  std::cout << std::oct;

  std::cout << std::numeric_limits<unsigned long long>::max()
            << '\n';
  std::cout << std::showbase
            << std::numeric_limits<unsigned long long>::max()
            << '\n';
  return 0;
}

Outputs:

1777777777777777777777
0177777777777777777777

Problem exists for 10.3-PRERELEASE r296556 for amd64 as well as 11.0-CURRENT
r292991 for arm.

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


More information about the freebsd-amd64 mailing list