[cfe-dev] Non-portable cast in DataflowValues.h

Justin Handville uniheliodem at gmail.com
Sun Sep 23 16:47:09 PDT 2007


I am getting the following compile error when compiling for x86_64
FreeBSD.  The getHashValue function assumes that unsigned int and a
pointer are the same size, which is not true in the x86_64 ABI.

In file included from
/packages/llvm-trunk/tools/clang/Analysis/../include/clang/Analysis/UninitializedValues.h:19,
                 from UninitializedValues.cpp:14:
/packages/llvm-trunk/tools/clang/Analysis/../include/clang/Analysis/DataflowValues.h:
In static member function 'static unsigned int
llvm::DenseMapInfo<clang::CFG::Edge>::getHashValue(const
clang::CFG::Edge&)':
/packages/llvm-trunk/tools/clang/Analysis/../include/clang/Analysis/DataflowValues.h:40:
error: cast from 'const clang::CFGBlock*' to 'unsigned int' loses
precision
/packages/llvm-trunk/tools/clang/Analysis/../include/clang/Analysis/DataflowValues.h:41:
error: cast from 'const clang::CFGBlock*' to 'unsigned int' loses
precision
/packages/llvm-trunk/tools/clang/Analysis/../include/clang/Analysis/DataflowValues.h:42:
error: cast from 'const clang::CFGBlock*' to 'unsigned int' loses
precision
/packages/llvm-trunk/tools/clang/Analysis/../include/clang/Analysis/DataflowValues.h:43:
error: cast from 'const clang::CFGBlock*' to 'unsigned int' loses
precision
gmake[1]: *** [/packages/llvm-trunk/tools/clang/Analysis/Debug/UninitializedValues.o]
Error 1
gmake[1]: Leaving directory `/packages/llvm-trunk/tools/clang/Analysis'
gmake: *** [all] Error 1



More information about the cfe-dev mailing list