Search

Visual C++: numeric_limits<char> min/max incorrect when using /J by bjehlert

Closed
as Fixed Help for as Fixed

1
0
Sign in
to vote
Type: Bug
ID: 548693
Opened: 4/4/2010 10:49:59 PM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
When compiling with /J, numeric_limits<char> should return the same values as numeric_limits<unsigned char>, but does not. Instead, the following values are given:

min: 128 (expected: 0)
max: 127 (expected: 255)
Details (expand)

Product Language

English

Version

Visual Studio 2010 Release Candidate

Operating System

Windows 7

Operating System Language

English

Steps to Reproduce

Compile the following program using /J

#include <iostream>
#include <limits>

int main(void)
{
    std::cout << "numeric_limits<char>::min(): " << (int)std::numeric_limits<char>::min() << std::endl;
    std::cout << "numeric_limits<char>::max(): " << (int)std::numeric_limits<char>::max() << std::endl;

    return 0;
}

Actual Results

Prints the following:

numeric_limits<char>::min(): 128
numeric_limits<char>::max(): 127

Expected Results

numeric_limits<char>::min(): 0
numeric_limits<char>::max(): 255
      You can indicate your satisfaction with how Microsoft handled this issue by completing this quick 3 question survey. [Details]

 

File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 6/22/2010 at 1:49 PM
Hi,

Thanks for reporting this bug. We've fixed it, and the fix will be available in VC11. The fix was to make numeric_limits header-only, which has the side effect of increasing performance.

If you have any further questions, feel free to E-mail me at stl@microsoft.com .

Stephan T. Lavavej
Visual C++ Libraries Developer
Posted by Microsoft on 4/6/2010 at 12:20 AM
We were able to reproduce the issue you are seeing. We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 4/5/2010 at 4:03 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.