bug-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug report: g++ 2.96 on Linux


From: Tom Choi
Subject: Bug report: g++ 2.96 on Linux
Date: Fri, 27 Sep 2002 18:21:07 -0500 (CDT)

Hello,

We used g++ 2.96 to build our product on Linux RH 7.2. 

We could build our product without any build error. But soon as we try to run 
the optimized build, we got a core-dump.  The debug build never got the 
core-dump. 

The bug is causes by some incorrect  because of which
a constructor for mathUInt64 which takes a double input does not work right.

Here is the problem code:

mathUInt64::mathUInt64(const double theValue, const char* debugString)
: baseObj(debugString)
, m_Value((UINT64)theValue)
{
   agAssert (theValue >= 0);
}

Here is the workaround:

Just putting a printf in the constructor changes the optimization and things
start working fine as the following code.

mathUInt64::mathUInt64(const double theValue, const char* debugString)
: baseObj(debugString)
, m_Value((UINT64)theValue)
{
   printf ("Constructing theValue: %lf m_Value: %lld\n", theValue, m_Value);
   agAssert (theValue >= 0);
}

This is a temporary solution. 
Please give us a right solution to fix this problem.

Thanks,
Tom






reply via email to

[Prev in Thread] Current Thread [Next in Thread]