Bug 132730 - std::numeric_limits<long>::max() is -1 with -m32 flag
Summary: std::numeric_limits<long>::max() is -1 with -m32 flag
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gcc (Show other bugs)
(Show other bugs)
Version: 3.0
Hardware: x86_64 Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-09-16 14:06 UTC by Göran Uddeborg
Modified: 2007-11-30 22:07 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-12-21 21:02:05 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2004:584 normal SHIPPED_LIVE Updated gcc packages 2004-12-21 05:00:00 UTC

Description Göran Uddeborg 2004-09-16 14:06:02 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.4.3)
Gecko/20040803

Description of problem:
The value of std::numeric_limits<long>::max() when compiled with the
x86_64 compiler, with the -m32 flag to produce i386 code, is -1.

Version-Release number of selected component (if applicable):
gcc-3.2.3-42

How reproducible:
Always

Steps to Reproduce:
1.Create this file:

#include <iostream>
#include <limits>
#include <climits>

int main(int argc, char **argv)
{
  std::cout << std::numeric_limits<long>::max() << std::endl;
  return 0;
}

2.Compile with "c++ -m32 h.cc -o h"
3.Run with "./h"

Actual Results:  -1

Expected Results:  2147483647

Comment 1 Jakub Jelinek 2004-10-05 20:01:32 UTC
This is fixed properly in GCC 3.3 and above, unfortunately GCC 3.2
lacks the necessary infrastructure.
Guess some hack in std_limits.h will be needed.

Comment 2 Jakub Jelinek 2004-10-07 13:20:43 UTC
Should be fixed in gcc-3.2.3-46 which ought to show up in U4 beta.

Comment 3 John Flanagan 2004-12-21 21:02:05 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2004-584.html



Note You need to log in before you can comment on or make changes to this bug.