[LLVMdev] tiny compilation error with g++ 4.1.3

Reid Spencer rspencer at reidspencer.com
Wed May 16 09:40:25 PDT 2007


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




More information about the llvm-dev mailing list