dyninstAPI: fix warnings given by gcc 4.8
authorJosh Stone <jistone@redhat.com>
Thu, 30 May 2013 23:15:05 +0000 (16:15 -0700)
committerJosh Stone <jistone@redhat.com>
Thu, 30 May 2013 23:15:05 +0000 (16:15 -0700)
commit8a035430164e89f3eeaa1e6dca96b13486f68dce
tree12b85a730f6b9c05fd45ee9919ed28c208075c28
parent6304b7c32e686c2a6ddd7773c78b5dd74596b039
dyninstAPI: fix warnings given by gcc 4.8

Compiling ../../dyninstAPI/src/linux-x86.C
../../dyninstAPI/src/linux-x86.C: In member function ‘AstNodePtr PCProcess::createUnprotectStackAST()’:
../../dyninstAPI/src/linux-x86.C:179:68: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     args.push_back(AstNode::operandNode(AstNode::Constant, (void *)size));
                                                                    ^
Compiling ../../dyninstAPI/src/emit-x86.C
../../dyninstAPI/src/emit-x86.C: In member function ‘virtual bool EmitterIA32::emitBTRestores(baseTramp*, codeGen&)’:
../../dyninstAPI/src/emit-x86.C:702:10: warning: variable ‘localSpace’ set but not used [-Wunused-but-set-variable]
     bool localSpace;
          ^
Compiling ../../dyninstAPI/src/unix.C
../../dyninstAPI/src/unix.C:286:6: warning: unused parameter ‘rights’ [-Wunused-parameter]
 bool PCProcess::getMemoryAccessRights(Address start, PCMemPerm& rights) {
      ^
Compiling ../../dyninstAPI/src/stackwalk-x86.C
../../dyninstAPI/src/stackwalk-x86.C: In member function ‘virtual bool StackwalkInstrumentationHelper::isInstrumentation(Dyninst::Address, Dyninst::Address*, unsigned int*, bool*, bool*)’:
../../dyninstAPI/src/stackwalk-x86.C:131:18: warning: variable ‘func’ set but not used [-Wunused-but-set-variable]
   func_instance *func = NULL;
                  ^
Compiling ../../dyninstAPI/src/IAPI_to_AST.C
../../dyninstAPI/src/IAPI_to_AST.C: In member function ‘virtual void ASTFactory::visit(Dyninst::InstructionAPI::RegisterAST*)’:
../../dyninstAPI/src/IAPI_to_AST.C:93:54: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                       (void*)(convertRegID(r, unused))));
                                                      ^
Compiling ../src/Relocation/Widgets/CFWidget-x86.C
../src/Relocation/Widgets/CFWidget-x86.C: In member function ‘bool Dyninst::Relocation::CFWidget::generateIndirect(Dyninst::Relocation::CodeBuffer&, Dyninst::Relocation::CFWidget::Register, const Dyninst::Relocation::RelocBlock*, Dyninst::InstructionAPI::Instruction::Ptr)’:
../src/Relocation/Widgets/CFWidget-x86.C:85:98: warning: cast from type ‘const void*’ to type ‘unsigned char*’ casts away qualifiers [-Wcast-qual]
    ia32_decode(IA32_FULL_DECODER, (unsigned char *)insn->ptr(), orig_instr);
                                                                                                  ^
Compiling ../../dyninstAPI/src/BPatch_image.C
../../dyninstAPI/src/BPatch_image.C: In member function ‘BPatch_variableExpr* BPatch_image::findVariable(const char*, bool)’:
../../dyninstAPI/src/BPatch_image.C:699:19: warning: variable ‘var_as’ set but not used [-Wunused-but-set-variable]
     AddressSpace *var_as = NULL;
                   ^
Compiling ../../dyninstAPI/src/BPatch_snippet.C
../../dyninstAPI/src/BPatch_snippet.C: In constructor ‘BPatch_registerExpr::BPatch_registerExpr(Dyninst::MachRegister)’:
../../dyninstAPI/src/BPatch_snippet.C:967:58: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                                                  (void *)reg));
                                                          ^
../../dyninstAPI/src/BPatch_snippet.C: In function ‘void constructorHelper(void (* const&)(BPatch_point*, void*), bool, BPatch_stInterpret, AstNodePtr&, AstNodePtr&)’:
../../dyninstAPI/src/BPatch_snippet.C:1631:67: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     idNode = AstNode::operandNode(AstNode::Constant, (void*)(int) cb_id );
                                                                   ^
../../dyninstAPI/src/BPatch_snippet.C:1644:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     icNode = AstNode::operandNode(AstNode::Constant, (void*) ic );
                                                              ^
Compiling ../../dyninstAPI/src/BPatch_process.C
../../dyninstAPI/src/BPatch_process.C: In member function ‘virtual BPatch_object* BPatch_process::loadLibrary(const char*, bool)’:
../../dyninstAPI/src/BPatch_process.C:1009:18: warning: converting ‘false’ to pointer type ‘BPatch_object*’ [-Wconversion-null]
           return false;
                  ^
../../dyninstAPI/src/BPatch_process.C:1036:38: warning: converting ‘false’ to pointer type ‘BPatch_object*’ [-Wconversion-null]
    if (dlopen_func == NULL) return false;
                                      ^
../../dyninstAPI/src/BPatch_process.C: In member function ‘bool BPatch_process::protectAnalyzedCode()’:
../../dyninstAPI/src/BPatch_process.C:1740:10: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
     bool ret = true;
          ^
Compiling ../../dyninstAPI/src/ast.C
../../dyninstAPI/src/ast.C: In member function ‘bool AstOperatorNode::generateOptimizedAssignment(codeGen&, bool)’:
../../dyninstAPI/src/ast.C:902:13: warning: variable ‘data_oper’ set but not used [-Wunused-but-set-variable]
    AstNode *data_oper = NULL, *const_oper = NULL;
             ^
../../dyninstAPI/src/ast.C: In member function ‘virtual BPatch_type* AstOperatorNode::checkType()’:
../../dyninstAPI/src/ast.C:2270:52: warning: variable ‘eType’ set but not used [-Wunused-but-set-variable]
     BPatch_type *lType = NULL, *rType = NULL, *eType = NULL;
                                                    ^
Compiling ../../dyninstAPI/src/codegen.C
../../dyninstAPI/src/codegen.C: In member function ‘std::string codeGen::format() const’:
../../dyninstAPI/src/codegen.C:776:92: warning: cast from type ‘const void*’ to type ‘unsigned int*’ casts away qualifiers [-Wcast-qual]
      ret << "\t" << base << ": " << insn->format(base) << " / " << *((unsigned *)insn->ptr()) << endl;
                                                                                            ^
Compiling ../../dyninstAPI/src/image.C
../../dyninstAPI/src/image.C: In member function ‘Dyninst::SymtabAPI::Symbol* image::symbol_info(const string&)’:
../../dyninstAPI/src/image.C:2036:15: warning: converting ‘false’ to pointer type ‘Dyninst::SymtabAPI::Symbol*’ [-Wconversion-null]
        return false;
               ^
Compiling ../../dyninstAPI/src/mapped_object.C
../../dyninstAPI/src/mapped_object.C: In member function ‘block_instance* mapped_object::findBlockByEntry(Dyninst::Address)’:
../../dyninstAPI/src/mapped_object.C:632:52: warning: converting ‘false’ to pointer type ‘block_instance*’ [-Wconversion-null]
     if (!findBlocksByAddr(addr, allBlocks)) return false;
                                                    ^
Compiling ../../dyninstAPI/src/hybridOverwrites.C
../../dyninstAPI/src/hybridOverwrites.C: In member function ‘bool HybridAnalysisOW::removeLoop(HybridAnalysisOW::owLoop*, bool, BPatch_point*, bool)’:
../../dyninstAPI/src/hybridOverwrites.C:236:61: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
             overwriteAnalysis(writePoint,(void*)loop->getID());
                                                             ^
Compiling ../../dyninstAPI/src/dynProcess.C
../../dyninstAPI/src/dynProcess.C: In static member function ‘static PCProcess* PCProcess::setupForkedProcess(PCProcess*, Dyninst::ProcControlAPI::Process::ptr)’:
../../dyninstAPI/src/dynProcess.C:194:20: warning: converting ‘false’ to pointer type ‘PCProcess*’ [-Wconversion-null]
             return false;
                    ^
Compiling ../src/Relocation/Springboard.C
../src/Relocation/Springboard.C: In member function ‘Dyninst::Relocation::SpringboardBuilder::generateResult_t Dyninst::Relocation::SpringboardBuilder::generateSpringboard(std::list<codeGen>&, const Dyninst::Relocation::SpringboardReq&, Dyninst::Relocation::SpringboardMap&)’:
../src/Relocation/Springboard.C:217:13: warning: variable ‘size’ set but not used [-Wunused-but-set-variable]
    unsigned size;
             ^
16 files changed:
dyninstAPI/src/BPatch_image.C
dyninstAPI/src/BPatch_process.C
dyninstAPI/src/BPatch_snippet.C
dyninstAPI/src/IAPI_to_AST.C
dyninstAPI/src/Relocation/Springboard.C
dyninstAPI/src/Relocation/Widgets/CFWidget-x86.C
dyninstAPI/src/ast.C
dyninstAPI/src/codegen.C
dyninstAPI/src/dynProcess.C
dyninstAPI/src/emit-x86.C
dyninstAPI/src/hybridOverwrites.C
dyninstAPI/src/image.C
dyninstAPI/src/linux-x86.C
dyninstAPI/src/mapped_object.C
dyninstAPI/src/stackwalk-x86.C
dyninstAPI/src/unix.C