Opened 10 years ago

Closed 5 years ago

#7019 closed Bugs (wontfix)

In libs/format/test/format_test3.cpp, 64-bit Solaris stlport4 iostream produces different result for stlport4

Reported by: Mike Liang <mtliang@…> Owned by: James E. King, III
Milestone: To Be Determined Component: format
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

On Solaris for both SPARC and x86, building the following on Sun Studio with "CC -m64" will produce 8 digits (ffffffff), and building with "CC -m64 -library=stlport4" will produce 16 digits (ffffffffffffffff).

#include <iostream>

int main() {

std::cout << std::hex << -1 << std::endl;

return 0;

}

This difference in behavior causes format_test3 on 64-bit STLPort4 Solaris builds to fail the nesting test.

The attached patch matches actual output in this situation. Not sure if pattern needs to be changed to demonstrate nesting for the 16 character case.

Attachments (1)

format_test3.cpp.patch (704 bytes ) - added by Mike Liang <mtliang@…> 10 years ago.

Download all attachments as: .zip

Change History (4)

by Mike Liang <mtliang@…>, 10 years ago

Attachment: format_test3.cpp.patch added

comment:1 by Mike Liang <mtliang@…>, 10 years ago

Component: Noneformat
Owner: set to Samuel Krempp

comment:2 by James E. King, III, 5 years ago

Owner: changed from Samuel Krempp to James E. King, III
Status: newassigned

comment:3 by James E. King, III, 5 years ago

Resolution: wontfix
Status: assignedclosed

I'm going to assume this is still an issue, given that in LP64 mode a long is 8 bytes. Here's the problem I have with the code and the patch:

  1. The format value is "x" which means integer.
  2. The value being inserted is -100 without decorations, so it should be treated as an integer.

Neither of these are long, which leads me to believe the submitted patch is a band-aid and not fixing the root cause. Furthermore, the boost project does not have a sunpro regression test in the matrix (http://www.boost.org/development/tests/develop/developer/format.html). I don't have an environment to debug this in either.

Further, the example you put into your description appears non-conformant to the standard. The value -1 is an integer, not a long integer. Even with stlsoft, _STLSOFT_SIZEOF_INT is always 4 even if _LP64 mode is on. (see: stlsoft-1.9.124 headers, include/stlsort/internal/cccap/sunpro.h). Given the failure occurs when stlsoft is added, my guess is stlsoft is to blame.

I am going to close this issue as wontfix since the environment is not conforming to the language rules.

Note: See TracTickets for help on using tickets.