Basile STARYNKEVITCH
2007-May-16 12:06 UTC
[LLVMdev] tiny compilation error with g++ 4.1.3
Hello All
File llvm/lib/ExecutionEngine/Interpreter/Execution.cpp (cvs rev 1.182)
fails to compile with g++ 4.1.3 (Debian/Sid/AMD64 system)
make[2]: Leaving directory `/usr/src/Lang/llvm/_Obj64/lib/Target'
make[2]: Entering directory `/usr/src/Lang/llvm/_Obj64/lib/ExecutionEngine'
make[3]: Entering directory
`/usr/src/Lang/llvm/_Obj64/lib/ExecutionEngine/Interpreter'
llvm[3]: Compiling Execution.cpp for Debug build
/usr/src/Lang/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp: In function
'void PrintGenericValue(const llvm::GenericValue&, const
llvm::Type*)':
/usr/src/Lang/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1347: error:
cast from 'void*' to 'unsigned int' loses precision
The trivial patch which works for me is to use intptr_t instead of unsigned,
hence replacing the faulty line with
case Type::PointerTyID: DOUT << "void* " <<
(intptr_t)(Val.PointerVal); break;
Regards
--
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faïencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***
Hi Basile, On Wed, 2007-05-16 at 14:06 +0200, Basile STARYNKEVITCH wrote:> Hello All > > File llvm/lib/ExecutionEngine/Interpreter/Execution.cpp (cvs rev 1.182) > fails to compile with g++ 4.1.3 (Debian/Sid/AMD64 system) > > make[2]: Leaving directory `/usr/src/Lang/llvm/_Obj64/lib/Target' > make[2]: Entering directory `/usr/src/Lang/llvm/_Obj64/lib/ExecutionEngine' > make[3]: Entering directory `/usr/src/Lang/llvm/_Obj64/lib/ExecutionEngine/Interpreter' > llvm[3]: Compiling Execution.cpp for Debug build > /usr/src/Lang/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp: In function 'void PrintGenericValue(const llvm::GenericValue&, const llvm::Type*)': > /usr/src/Lang/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1347: error: cast from 'void*' to 'unsigned int' loses precision > > > The trivial patch which works for me is to use intptr_t instead of unsigned, hence replacing the faulty line with > > case Type::PointerTyID: DOUT << "void* " << (intptr_t)(Val.PointerVal); break;Yup. I made this change. Thanks, Reid.> > Regards
Possibly Parallel Threads
- [LLVMdev] reading a module from a memory string (BitCode)
- [LLVMdev] which g++ to compile LLVM CVS on Linux/AMD64?
- [LLVMdev] which g++ to compile LLVM CVS on Linux/AMD64?
- [LLVMdev] which g++ to compile LLVM CVS on Linux/AMD64?
- [LLVMdev] LLVM assembly without basic block