|
Mark Thomas
|
ceilf() causing infinite loop
|
|
Mark Thomas
11/10/2011 4:26 PM
post90011
|
ceilf() causing infinite loop
I was having trouble using unordered_map<> with the gcc 4.6.1 tool chain targeting x86 and linking against "GNU with
exceptions". The release build would hang when unordered_map<> constructor was called, but not hang in the debug build.
Debugging the release build shows it gets stuck in ceilf().
After looking over gcc source I see that unordered_map<> is fairly different between release and debug, so debug
apparently doesn't call ceilf(). The release version actually calls __builtin_ceil() in hashtable_policy.h.
So I decided to call ceilf() myself and sure enough, it hangs in debug and release builds. Then I tried gcc 4.4.2 and it
also hangs.
Appears that C ceilf() calls C++ 'float ceil( float )', which calls C ceilf() again...hence an infinite loop.
I downloaded and tried the exact same code in MinGW with gcc 4.6.1 and it works fine.
I'm getting by with using map<> instead, but I would like to use unordered_map<> if there is a fix.
|
|
|
|
|