s-cherepanov / rose-r5rs

Automatically exported from code.google.com/p/rose-r5rs
0 stars 0 forks source link

Compilation fails under 64-bit environment with G++ 3.4.5 #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compile the code with G++ 3.4.5

What is the expected output? What do you see instead?
Compilation fails, with the following errors:

In file included from include/rose/gc/gc.hpp:4,
                 from test/gc_test.cpp:1:
include/rose/gc/registry.hpp: In static member function `static unsigned int 
rose::gc::registry::h2a(const rose::gc::handle_base*)':
include/rose/gc/registry.hpp:78: error: reinterpret_cast from `const 
rose::gc::handle_base*' to `unsigned int' loses precision
i
...

Please use labels and text to provide additional information.

Original issue reported on code.google.com by rhythm.mail on 14 Aug 2010 at 4:08

GoogleCodeExporter commented 9 years ago
Fixed in changeset 83:22cbbe87385b:

The problem is that under 64-bit G++ 3.4.5, sizeof(unsigned int) is 4
while sizeof(void*) is 8.  So rose::gc::registry::address_type is not
long enough to hold a pointer.

The solution is:

    typedef
        boost::uint_t<sizeof(void*) * 8>::exact
        address_type;

Original comment by rhythm.mail on 14 Aug 2010 at 4:18