diff --git a/SConscript b/SConscript
index 344397e4731fac9b7a00275a4405d78065433df8..1006ebbd186d263271ca109f767ed2a91dc950d7 100644
--- a/SConscript
+++ b/SConscript
@@ -33,7 +33,7 @@ else:
         os.makedirs(ELFIO_DIR)     # make directory 
         tgz=tarfile.open(os.environ['SECURITY_TRANSFORMS_HOME']+"/third_party/elfio-2.2.tar.gz", "r:gz")
         print 'Extracting elfio tarball'
-        tgz.list(verbose=False)
+        #tgz.list(verbose=False)
         tgz.extractall(ELFIO_DIR)
     	shutil.copytree(ELFIO_DIR+"elfio-2.2/elfio", os.environ['SECURITY_TRANSFORMS_HOME']+"/include/elfio")
         shutil.copy(os.path.join(os.environ['SECURITY_TRANSFORMS_HOME'],"third_party","elfio.hpp"), 
@@ -47,7 +47,7 @@ else:
         os.makedirs(SQLITE3_DIR)     # make directory 
         tgz=tarfile.open(os.path.join(os.environ['SECURITY_TRANSFORMS_HOME'], 'third_party/sqlite-autoconf-3071300.tar.gz'), "r:gz")
         print 'Extracting needed files from sqlite3 tarball'
-        tgz.list(verbose=False)
+        #tgz.list(verbose=False)
         tgz.extract('sqlite-autoconf-3071300/sqlite3.h', SQLITE3_DIR)
         tgz.extract('sqlite-autoconf-3071300/sqlite3.c', SQLITE3_DIR)
 		# copy sqlite3.h
@@ -87,7 +87,6 @@ if "CYGWIN" in sysname:
 
 Export('env')
 
-
 libEXEIO=SConscript("libEXEIO/SConscript", variant_dir='scons_build/libEXEIO')
 libbea=SConscript("beaengine/SConscript", variant_dir='scons_build/beaengine')
 libMEDSannotation=SConscript("libMEDSannotation/SConscript", variant_dir='scons_build/libMEDSannotation')
diff --git a/SConstruct b/SConstruct
index ba6529c53d1501b0a951fa85f950b6e4b231c579..437547c10469b89543a52aff04ccf79f8022f069 100644
--- a/SConstruct
+++ b/SConstruct
@@ -9,9 +9,9 @@ env=Environment()
 
 
 # default build options
-env.Replace(CFLAGS="-fPIC -w ")
-env.Replace(CXXFLAGS="-fPIC -w ")
-env.Replace(LINKFLAGS="-fPIC -w ")
+env.Replace(CFLAGS="-fPIC  -Wall ")
+env.Replace(CXXFLAGS="-fPIC  -Wall ")
+env.Replace(LINKFLAGS="-fPIC -Wall ")
 
 # parse arguments
 env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
diff --git a/include/i686/config.h b/include/i686/config.h
index 8f59038df91c3b9e131e75b7a2c62e2c0b1c86e7..5a5bcb937a1f358117421dc34969b7a99f325225 100644
--- a/include/i686/config.h
+++ b/include/i686/config.h
@@ -58,18 +58,4 @@ typedef s_uint64_t 	   counter_t;
 #define NULL 0
 #endif
 
-#include <elfio/elfio.hpp>
-
-typedef ELFIO::Elf32_Ehdr  IRDB_Elf_Ehdr;
-typedef ELFIO::Elf32_Shdr  IRDB_Elf_Shdr;
-typedef ELFIO::Elf32_Off   IRDB_Elf_Off;
-typedef ELFIO::Elf32_Half  IRDB_Elf_Half;
-typedef ELFIO::Elf32_Word  IRDB_Elf_Word;
-typedef ELFIO::Elf32_Addr  IRDB_Elf_Addr;
-typedef ELFIO::Elf32_Sym  IRDB_Elf_Sym;
-typedef ELFIO::Elf32_Rel  IRDB_Elf_Rel;
-typedef ELFIO::Elf32_Rela  IRDB_Elf_Rela;
-#define IRDB_ELF_ST_TYPE ELF32_ST_TYPE
-
-
 #endif
diff --git a/include/i86pc/config.h b/include/i86pc/config.h
index 8f59038df91c3b9e131e75b7a2c62e2c0b1c86e7..b7cbcf52ada5b42785dd2a678c7ceb0751721a98 100644
--- a/include/i86pc/config.h
+++ b/include/i86pc/config.h
@@ -58,18 +58,5 @@ typedef s_uint64_t 	   counter_t;
 #define NULL 0
 #endif
 
-#include <elfio/elfio.hpp>
-
-typedef ELFIO::Elf32_Ehdr  IRDB_Elf_Ehdr;
-typedef ELFIO::Elf32_Shdr  IRDB_Elf_Shdr;
-typedef ELFIO::Elf32_Off   IRDB_Elf_Off;
-typedef ELFIO::Elf32_Half  IRDB_Elf_Half;
-typedef ELFIO::Elf32_Word  IRDB_Elf_Word;
-typedef ELFIO::Elf32_Addr  IRDB_Elf_Addr;
-typedef ELFIO::Elf32_Sym  IRDB_Elf_Sym;
-typedef ELFIO::Elf32_Rel  IRDB_Elf_Rel;
-typedef ELFIO::Elf32_Rela  IRDB_Elf_Rela;
-#define IRDB_ELF_ST_TYPE ELF32_ST_TYPE
-
 
 #endif
diff --git a/include/x86_64/config.h b/include/x86_64/config.h
index fbb0ba317bb61ce9f7f299bcae29a5750d58cf5d..25a7644c1b861d375b4eb92a20555f9f4836203c 100644
--- a/include/x86_64/config.h
+++ b/include/x86_64/config.h
@@ -58,19 +58,4 @@ typedef s_uint64_t 	   counter_t;
 #define NULL 0
 #endif
 
-#include <elf.h>
-
-typedef Elf64_Ehdr  IRDB_Elf_Ehdr;
-typedef Elf64_Shdr  IRDB_Elf_Shdr;
-typedef Elf64_Off   IRDB_Elf_Off;
-typedef Elf64_Half  IRDB_Elf_Half;
-typedef Elf64_Word  IRDB_Elf_Word;
-typedef Elf64_Addr  IRDB_Elf_Addr;
-typedef Elf64_Sym  IRDB_Elf_Sym;
-typedef Elf64_Rel  IRDB_Elf_Rel;
-typedef Elf64_Rela  IRDB_Elf_Rela;
-
-#define IRDB_ELF_ST_TYPE ELF64_ST_TYPE
-
-
 #endif
diff --git a/libEXEIO/include/exeio.h b/libEXEIO/include/exeio.h
index 08ddd852baf8d31fe375d19fd61b2fbb6661c61d..76e09882115bdf102ce4852f14ff52d6fade3293 100644
--- a/libEXEIO/include/exeio.h
+++ b/libEXEIO/include/exeio.h
@@ -21,6 +21,7 @@ namespace EXEIO
 	class exeio_section_t
 	{
 		public: 
+			virtual ~exeio_section_t() {}  
 			virtual bool isLoadable() const =0;
 			virtual bool isExecutable() const =0;
 			virtual bool isWriteable() const =0;
diff --git a/libEXEIO/include/exeio_elf.h b/libEXEIO/include/exeio_elf.h
index f48f755d6fcb6f2e6c094e72972db79f9f2c21f2..91f2a39c2a3f684f7e6015177711257cd71c57f1 100644
--- a/libEXEIO/include/exeio_elf.h
+++ b/libEXEIO/include/exeio_elf.h
@@ -6,9 +6,11 @@
 #include <assert.h>
 
 
-#include "targ-config.h"
+// #include "targ-config.h"
+#pragma GCC diagnostic ignored "-Wsign-compare"
 #include "elfio/elfio.hpp"
 #include "elfio/elfio_dump.hpp"
+#pragma GCC diagnostic pop
 
 class exeio_backend;
 class exeio_section;
@@ -42,7 +44,7 @@ namespace EXEIO
 	{
 		public:
 			exeio_elf_backend_t() : e(NULL), main(NULL) {}
-			~exeio_elf_backend_t()
+			virtual ~exeio_elf_backend_t()
 			{
 				if(!main)
 					return;
@@ -50,7 +52,8 @@ namespace EXEIO
 				for(int i=0;i<e->sections.size(); ++i)
 				{
 					// copy each section into the main class' structure.
-					delete main->sections[i];
+					EXEIO::exeio_elf_section_t* sec=dynamic_cast<EXEIO::exeio_elf_section_t*>(main->sections[i]);
+					delete sec;
 				}
 
 				// remove the elfio class.
diff --git a/libEXEIO/include/exeio_pe.h b/libEXEIO/include/exeio_pe.h
index c77995c623ce2a3753fa3bd0152b51dc5e5aed7c..5b43cdea0b897bda6a710ceca3d665b2c58af071 100644
--- a/libEXEIO/include/exeio_pe.h
+++ b/libEXEIO/include/exeio_pe.h
@@ -43,7 +43,14 @@ namespace EXEIO
 	class exeio_pe_backend_t : public exeio_backend_t
 	{
 		public:
-			exeio_pe_backend_t() : e(NULL), main(NULL), pe_sections(NULL) {}
+			exeio_pe_backend_t() 
+				: 
+				e(NULL), 
+				pe_sections(NULL),
+				main(NULL)
+			{
+			}
+
 			~exeio_pe_backend_t()
 			{
 				if(!main)
@@ -52,7 +59,8 @@ namespace EXEIO
 				for(int i=0;i<main->sections.size(); ++i)
 				{
 					// copy each section into the main class' structure.
-					delete main->sections[i];
+					EXEIO::exeio_pe_section_t* sec=dynamic_cast<EXEIO::exeio_pe_section_t*>(main->sections[i]);			
+					delete sec;
 				}
 
 				// remove the pe_bliss class.
diff --git a/libEXEIO/src/SConscript b/libEXEIO/src/SConscript
index dea83ae00003b18590677d489fe82f0da4cda819..824d768770c5ed792dedb65dbf6689f511e16436 100644
--- a/libEXEIO/src/SConscript
+++ b/libEXEIO/src/SConscript
@@ -17,9 +17,6 @@ cpppath='''
 	$SECURITY_TRANSFORMS_HOME/pebliss/trunk/pe_lib/
 	'''
 
-#myenv.Append(CCFLAGS="-Wp,-w -Wall")
-myenv.Append(CCFLAGS=" -w ")
-
 myenv=myenv.Clone(CPPPATH=Split(cpppath))
 lib=myenv.Library(libname, Split(files))
 
diff --git a/libEXEIO/test/SConscript b/libEXEIO/test/SConscript
index 8d8e20a485a414d0166b203521a1b9b5b3713230..2b47d858e13b0928b350027440945f8928537a39 100644
--- a/libEXEIO/test/SConscript
+++ b/libEXEIO/test/SConscript
@@ -22,9 +22,6 @@ libpath='''
 	$SECURITY_TRANSFORMS_HOME/lib/
 	'''
 
-#myenv.Append(CCFLAGS="-Wp,-w -Wall")
-myenv.Append(CCFLAGS=" -g ")
-
 libs=   '''
 	EXEIO
 	pebliss
diff --git a/libElfDep/src/elfdep.cpp b/libElfDep/src/elfdep.cpp
index 7dab1a0a6e2def77280d97712c8ab558db858180..dd476260560b3e0ab248cc58daac6a90d26ea5bd 100644
--- a/libElfDep/src/elfdep.cpp
+++ b/libElfDep/src/elfdep.cpp
@@ -86,7 +86,7 @@ static void insert_into_scoop_at(const string &str, DataScoop_t* scoop, FileIR_t
 	// update each reloc to point to the new location.
 	for_each(scoop->GetRelocations().begin(), scoop->GetRelocations().end(), [str,at](Relocation_t* reloc)
 	{
-		if(reloc->GetOffset()>=at)
+		if((unsigned int)reloc->GetOffset()>=at)
 			reloc->SetOffset(reloc->GetOffset()+str.size());
 		
 	});
@@ -424,7 +424,7 @@ void ElfDependencies_t::ElfDependenciesImpl_t<T_Elf_Sym,T_Elf_Rela,T_Elf_Dyn,rel
 		{
 			cout<<"Inserting new DT_NEEDED at index "<<dec<<index<<endl;
 			// found a null terminator entry.
-			for(auto i=0; i<sizeof(T_Elf_Dyn); i++)
+			for(auto i=0U; i<sizeof(T_Elf_Dyn); i++)
 			{
 				// copy new_dynamic_entry ontop of null entry.
 				dynamic_scoop->GetContents()[index*sizeof(T_Elf_Dyn) + i ] = ((char*)&new_dynamic_entry)[i];
@@ -456,10 +456,6 @@ void ElfDependencies_t::ElfDependenciesImpl_t<T_Elf_Sym,T_Elf_Rela,T_Elf_Dyn,rel
 template<typename T_Elf_Sym, typename T_Elf_Rela, typename T_Elf_Dyn, int reloc_type, int rela_shift, int ptrsize>
 void ElfDependencies_t::ElfDependenciesImpl_t<T_Elf_Sym,T_Elf_Rela,T_Elf_Dyn,reloc_type,rela_shift,ptrsize>::prependLibraryDepedencies(const string &libraryName)
 {
-	const auto is_dt_needed=[](const T_Elf_Dyn& dyn_p) 
-		{ 	
-			return dyn_p.d_tag==DT_NEEDED; 
-		} ;
 	const auto firp=getFileIR();
 
 	auto dynamic_scoop=find_scoop(firp,".dynamic");
diff --git a/libIRDB/include/core/eh.hpp b/libIRDB/include/core/eh.hpp
index afdaa38917cbb841608505e31868b3b0d9b136ce..3f52768f2afc528834a7c91f48dc3fd61586d5ac 100644
--- a/libIRDB/include/core/eh.hpp
+++ b/libIRDB/include/core/eh.hpp
@@ -43,11 +43,15 @@ class EhProgram_t : public BaseObj_t
 	EhProgram_t(db_id_t id, const uint64_t caf, const int64_t daf, const uint8_t rr, const uint8_t p_ptrsize)
 		: 
 		BaseObj_t(NULL), 
-		code_alignment_factor(caf), 
-		data_alignment_factor(daf), 
+		code_alignment_factor(0), 
+		data_alignment_factor(0), 
 		return_register(rr), 
 		ptrsize(p_ptrsize) 
-	{ SetBaseID(id); }
+	{ 
+		SetDataAlignmentFactor(daf);
+		SetCodeAlignmentFactor(caf);
+		SetBaseID(id); 
+	}
 
 
 	EhProgramListing_t& GetCIEProgram() { return cie_program; }
@@ -57,13 +61,21 @@ class EhProgram_t : public BaseObj_t
 	const EhProgramListing_t& GetFDEProgram() const { return fde_program; }
 
         uint64_t GetCodeAlignmentFactor() const { return code_alignment_factor; }
-        void SetCodeAlignmentFactor(const uint64_t caf) { code_alignment_factor=caf; }
+        void SetCodeAlignmentFactor(const uint64_t caf) 
+	{ 	
+		if ( ((uint8_t)caf) != caf  ) throw std::logic_error(std::string()+"Invalid code alignment factor in call to "+__FUNCTION__);
+		code_alignment_factor=(uint8_t)caf; 
+	}
 
         int64_t GetDataAlignmentFactor() const { return data_alignment_factor; }
-        void SetDataAlignmentFactor(const int64_t daf) { data_alignment_factor=daf; }
+        void SetDataAlignmentFactor(const int64_t daf) 
+	{ 
+		if ( (( int8_t)daf) != daf  ) throw std::logic_error(std::string()+"Invalid datat alignment factor in call to "+__FUNCTION__);
+		data_alignment_factor=(int8_t)daf; 
+	}
 
         int64_t GetReturnRegNumber() const { return return_register; }
-        void SetReturnRegNumber(const int64_t rr) { return_register=rr; }
+        void SetReturnRegNumber(const uint8_t rr) { return_register=rr; }
 
         std::vector<std::string> WriteToDB(File_t* fid);    // writes to DB, ID is not -1.
 
diff --git a/libIRDB/include/core/file.hpp b/libIRDB/include/core/file.hpp
index a702a427de8820126f2041cf0dfabb1c7646d8d1..5a33f8aa4c475183403d2192511c9365a1c6ddde 100644
--- a/libIRDB/include/core/file.hpp
+++ b/libIRDB/include/core/file.hpp
@@ -31,7 +31,7 @@ class File_t : public BaseObj_t
 		const std::string &ehpgms, const std::string &ehcss, 
 		const db_id_t &doipid);
 
-        File_t(db_id_t file_id) : BaseObj_t(NULL) { assert(0);}          // read from DB       
+        File_t(db_id_t file_id) : BaseObj_t(NULL) { (void)file_id; assert(0);}          // read from DB       
         void WriteToDB() { assert(0); }   // writes to DB ID is not -1.
 
         std::string GetAddressTableName() const { return address_table_name; }
diff --git a/libIRDB/include/core/fileir.hpp b/libIRDB/include/core/fileir.hpp
index 4a21a64f31c5230447090c2140824af7e1dd88f5..b540d5287a2fc1e00474365653a2e52dac72f7d2 100644
--- a/libIRDB/include/core/fileir.hpp
+++ b/libIRDB/include/core/fileir.hpp
@@ -92,7 +92,7 @@ class FileIR_t : public BaseObj_t
 		void ChangeRegistryKey(Instruction_t* orig, Instruction_t* updated);
 
 		static int GetArchitectureBitWidth() ;
-		static int SetArchitectureBitWidth(const int width);
+		static void SetArchitectureBitWidth(const int width);
 		void SetArchitecture();
 
 		// Lookup a scoop by address
diff --git a/libIRDB/include/core/function.hpp b/libIRDB/include/core/function.hpp
index 25b39d85fd841151ac998e40e7c79baabf5740a7..a4d80aaa63789619764fcec387b0e14499e7790e 100644
--- a/libIRDB/include/core/function.hpp
+++ b/libIRDB/include/core/function.hpp
@@ -35,11 +35,11 @@ class Function_t : public BaseObj_t
 
         int GetStackFrameSize() const { return stack_frame_size; }
         const std::string& GetName() const { return name; }
-        int GetOutArgsRegionSize() const { return out_args_region_size; }
+        uint32_t GetOutArgsRegionSize() const { return out_args_region_size; }
 
         void SetStackFrameSize(int size) { stack_frame_size=size; }
         void SetName(std::string newname)	 { name=newname; }
-        void SetOutArgsRegionSize(int oa_size) {out_args_region_size=oa_size;}
+        void SetOutArgsRegionSize(uint32_t oa_size) {out_args_region_size=oa_size;}
 
 	void SetEntryPoint(Instruction_t *insn) {entry_point=insn;}
 	Instruction_t* GetEntryPoint() const { return entry_point;}
@@ -62,7 +62,7 @@ class Function_t : public BaseObj_t
 	InstructionSet_t my_insns;
         int stack_frame_size;
         std::string name;
-        int out_args_region_size;
+        uint32_t out_args_region_size;
         bool use_fp;
         bool is_safe;
 	FuncType_t *function_type;
diff --git a/libIRDB/include/core/type.hpp b/libIRDB/include/core/type.hpp
index a0b80301702f79e853a0fc6f0041b988816f08c5..88e83384dd221085e322542c7041cb0855840479 100644
--- a/libIRDB/include/core/type.hpp
+++ b/libIRDB/include/core/type.hpp
@@ -110,7 +110,7 @@ class AggregateType_t : public Type_t
 		virtual bool IsAggregateType() const { return true; }
 
 		void AddAggregatedType(Type_t *t, int pos);
-		virtual int GetNumAggregatedTypes() const { return refTypes.size(); } 
+		virtual size_t GetNumAggregatedTypes() const { return refTypes.size(); } 
 		Type_t* GetAggregatedType(unsigned int pos) const { 
 			return (pos < (unsigned int)refTypes.size()) ? refTypes.at(pos) : NULL;
 		}
diff --git a/libIRDB/src/cfg/BasicBlock.cpp b/libIRDB/src/cfg/BasicBlock.cpp
index 16bc947d539282117892b4ea7084b6df4219f22d..bb0e5c7dc6feb45a39b1633f4d7b74c02c99c62d 100644
--- a/libIRDB/src/cfg/BasicBlock.cpp
+++ b/libIRDB/src/cfg/BasicBlock.cpp
@@ -146,12 +146,11 @@ void BasicBlock_t::BuildBlock
 
 std::ostream& libIRDB::operator<<(std::ostream& os, const BasicBlock_t& block)
 {
-	int i;
 	os<<block.is_exit_block;
 	os<<"\t ---- Starting block print -----" <<endl;
-	for(i=0;i<block.instructions.size();i++)
+	for(auto i=0U;i<block.instructions.size();i++)
 	{
-		Instruction_t* insn=block.instructions[i];
+		const auto insn=block.instructions[i];
 		os<<"\t Instruction "<<std::dec<<i<<" at " << std::hex << insn->GetAddress()->GetVirtualOffset() << " with id " << std::dec << insn->GetBaseID() << " " << insn->GetComment() << endl;
 	}
 	os<<"\t ---- done block print -----" <<endl;
@@ -163,12 +162,9 @@ std::ostream& libIRDB::operator<<(std::ostream& os, const BasicBlock_t& block)
 
 bool BasicBlock_t::EndsInBranch() 
 {
-	//DISASM d;
-	Instruction_t *branch=instructions[instructions.size()-1];	
-
+	const auto branch=instructions[instructions.size()-1];	
 	assert(branch);
 
-	//Disassemble(branch,d);
 	const auto d=DecodedInstruction_t(branch);
 	return d.isBranch();
 
@@ -176,19 +172,15 @@ bool BasicBlock_t::EndsInBranch()
 }
 bool BasicBlock_t::EndsInIndirectBranch() 
 {
-	//DISASM d;
-	Instruction_t *branch=instructions[instructions.size()-1];	
-
+	const auto *branch=instructions[instructions.size()-1];	
 	assert(branch);
 
-	//Disassemble(branch,d);
 	const auto d=DecodedInstruction_t(branch);
 
 	if(d.isReturn())
 		return true;
 	if(d.isUnconditionalBranch() || d.isCall())
 	{
-		//if((d.Argument1.ArgType&CONSTANT_TYPE)==0)
 		if(!d.getOperand(0).isConstant())
 			/* not a constant type */
 			return true;
@@ -201,27 +193,20 @@ bool BasicBlock_t::EndsInConditionalBranch()
 {
 	if(!EndsInBranch())
 		return false;
-	Instruction_t *branch=instructions[instructions.size()-1];	
+	const auto branch=instructions[instructions.size()-1];	
 	assert(branch);
-	//DISASM d;
-	//Disassemble(branch,d);
 	const auto d=DecodedInstruction_t(branch);
 
 	return d.isConditionalBranch(); 
-
-//	if(d.isReturn() || d.UnconditionalBranch() || d.isCall())
-//		return false;
-//
-//	return true;
-
 }
+
 Instruction_t* BasicBlock_t::GetBranchInstruction()
 
 {
 	if(!EndsInBranch())
 		return NULL;
 
-	Instruction_t *branch=instructions[instructions.size()-1];	
+	auto branch=instructions[instructions.size()-1];	
 	return branch;
 }
 
diff --git a/libIRDB/src/cfg/SConscript b/libIRDB/src/cfg/SConscript
index 3c8e4f514b46d13396e3929f64ea1202f7eb7ed5..327f3031ef7b3242ecc8a218ada63da15d5dd62b 100644
--- a/libIRDB/src/cfg/SConscript
+++ b/libIRDB/src/cfg/SConscript
@@ -15,8 +15,7 @@ cpppath='''
 	$SECURITY_TRANSFORMS_HOME/libIRDB/include/
 	'''
 
-#myenv.Append(CCFLAGS=" -Wall -W -Wextra -Wconversion ")
-myenv.Append(CCFLAGS=" -Wall -W -Wextra -Wconversion -std=c++11")
+myenv.Append(CCFLAGS=" -Wall -std=c++11")
 
 myenv=myenv.Clone(CPPPATH=Split(cpppath))
 lib=myenv.Library(libname, Split(files))
diff --git a/libIRDB/src/cfg/callgraph.cpp b/libIRDB/src/cfg/callgraph.cpp
index f1cda16f56d0f0a078f1310e17e5d2c2338d884a..68b0784a53ccd8a40cffba98e2213af3d91737a2 100644
--- a/libIRDB/src/cfg/callgraph.cpp
+++ b/libIRDB/src/cfg/callgraph.cpp
@@ -130,13 +130,11 @@ void Callgraph_t::AddFile(libIRDB::FileIR_t* const firp)
 	CreateNodes(firp);
 
 	// for each instruction 
-	set<Instruction_t*> &insns=firp->GetInstructions();
-	Instruction_t* insn=NULL, *prev=NULL;
-	for(set<Instruction_t*>::iterator it=insns.begin();
-			insns.end() != it;
-			++it, prev=insn)
+	auto &insns=firp->GetInstructions();
+
+	for(auto it=insns.begin(); insns.end() != it; ++it)
 	{
-		insn=*it;
+		auto insn=*it;
 		if(IsCallSite(insn) || IsTailJmpSite(insn))
 			MarkCallSite(insn);
 		if(IsPushJmpSite(insn))
@@ -145,7 +143,7 @@ void Callgraph_t::AddFile(libIRDB::FileIR_t* const firp)
 		if(insn->GetFunction() && insn->GetFunction()->GetEntryPoint()==insn
 			&& insn->GetIndirectBranchTargetAddress())
 		{
-				CallGraphNode_t *node = FindNode(insn->GetFunction());
+				auto node = FindNode(insn->GetFunction());
 				assert(node);
 				callees[&GetDefaultHellNode()].insert(node);
 				callers[node].insert(&GetDefaultHellNode());
@@ -159,25 +157,19 @@ void Callgraph_t::Dump(std::ostream& fout)
 	fout<<"Dumping callgraph ..."<<endl;
 
 	fout<<"Mapping one way ..."<<endl;
-	for(CGNodeToCGNodeSetMap_t::iterator it=callees.begin();
-		callees.end()!=it;
-		++it)
+	for(auto it=callees.begin(); callees.end()!=it; ++it)
 	{
 		CallGraphNode_t* node = it->first;
 
 		fout<<"Function "<<GetNodeName(node)<<" calls: ";
 		CallGraphNodeSet_t &node_callers=it->second;
-		for(CallGraphNodeSet_t::iterator it2=node_callers.begin();
-			node_callers.end()!=it2;
-			++it2)
+		for(auto it2=node_callers.begin(); node_callers.end()!=it2; ++it2)
 		{
 			CallGraphNode_t* the_callee=*it2;
 			fout<<GetNodeName(the_callee)<<", ";
 		}
 		fout<<endl;
-		for(CallSiteSet_t::iterator it2=GetCallSites(node).begin();
-			GetCallSites(node).end() != it2; 
-			++it2)
+		for(auto it2=GetCallSites(node).begin(); GetCallSites(node).end() != it2; ++it2)
 		{
 			CallSite_t the_call_site=*it2;
 			fout<<"\t"<<GetCallsiteDisassembly(the_call_site)<<endl;
@@ -185,9 +177,7 @@ void Callgraph_t::Dump(std::ostream& fout)
 	}
 
 	fout<<"Mapping the other way ..."<<endl;
-	for(CGNodeToCGNodeSetMap_t::iterator it=callers.begin();
-		callers.end()!=it;
-		++it)
+	for(auto it=callers.begin(); callers.end()!=it; ++it)
 	{
 		CallGraphNode_t* n=it->first;
 
@@ -206,20 +196,16 @@ void Callgraph_t::Dump(std::ostream& fout)
 
 
 	fout<<"Printing call sites..."<<endl;
-	for(NodeToCallSiteSetMap_t::iterator it=call_sites.begin();
-			call_sites.end()!=it;
-			++it)
+	for(auto it=call_sites.begin(); call_sites.end()!=it; ++it)
 	{
-		CallGraphNode_t *from_node=it->first;
-		CallSiteSet_t  call_sites_for_func=it->second;
+		auto from_node=it->first;
+		auto &call_sites_for_func=it->second;
 
 		fout<<"Call Sites for "<<GetNodeName(from_node)<<": ";
 
-		for(CallSiteSet_t::iterator it2=call_sites_for_func.begin();
-			call_sites_for_func.end() != it2; 
-			++it2)
+		for(auto it2=call_sites_for_func.begin(); call_sites_for_func.end() != it2; ++it2)
 		{
-			CallSite_t the_call_site=*it2;
+			auto the_call_site=*it2;
 			fout<<GetCallsiteDisassembly(the_call_site)<<", ";
 		}
 		fout<<endl;
@@ -244,9 +230,8 @@ cerr << "visiting node: " << GetNodeName(node) << " visited(size):" << visited.s
 
 	visited.insert(node);
 
-	CallGraphNodeSet_t directPredecessors = GetCallersOfNode(node);
-	CallGraphNodeSet_t::iterator it;
-	for (it = directPredecessors.begin(); it != directPredecessors.end(); ++it)
+	auto directPredecessors = GetCallersOfNode(node);
+	for (auto it = directPredecessors.begin(); it != directPredecessors.end(); ++it)
 	{
 		if (visited.count(*it) == 0)
 		{
@@ -267,20 +252,20 @@ CallGraphNode_t* Callgraph_t::FindNode(Function_t* const fn)
 
 void Callgraph_t::GetAncestors(Function_t* const fn, CallGraphNodeSet_t &ancestors, bool skipHellNode)
 {
-	CallGraphNode_t* node = FindNode(fn);
+	auto node = FindNode(fn);
 	if (node)
 		GetAncestors(node, ancestors, skipHellNode);
 }
 
 void Callgraph_t::GetAncestors(CallGraphNode_t* const node, CallGraphNodeSet_t &ancestors, bool skipHellNode)
 {
-	CallGraphNodeSet_t visited;
+	auto visited=CallGraphNodeSet_t();
 	_GetAncestors(node, ancestors, visited, skipHellNode);
 }
 
 bool Callgraph_t::Reachable(CallGraphNode_t* const from, CallGraphNode_t* const to, bool skipHellNode)
 {
-	CallGraphNodeSet_t ancestors;
+	auto ancestors=CallGraphNodeSet_t();
 	GetAncestors(to, ancestors, skipHellNode);
 	return (ancestors.count(from) > 0);
 }
diff --git a/libIRDB/src/cfg/domgraph.cpp b/libIRDB/src/cfg/domgraph.cpp
index 6448b3b2d1911e187024b5a961bbc9055fd0b971..e5fb3a6d1e9951d95741f970937a90d20ac2cc6c 100644
--- a/libIRDB/src/cfg/domgraph.cpp
+++ b/libIRDB/src/cfg/domgraph.cpp
@@ -24,16 +24,16 @@ DominatorGraph_t::DominatorGraph_t(const ControlFlowGraph_t* p_cfg, bool needs_p
 	{
 		return node->GetPredecessors();
 	};
-	pred_func_ptr_t func_get_successors=[](const BasicBlock_t* node) -> const BasicBlockSet_t&
-	{
-		return node->GetSuccessors();
-	};
 
 	dom_graph=Dom_Comp(p_cfg->GetBlocks(), func_get_predecessors, p_cfg->GetEntry());
 	idom_graph=Idom_Comp(p_cfg->GetBlocks(), dom_graph, p_cfg->GetEntry());
 
 // a func may have multiple exit nodes.  how do we deal with that?
 // psuedo-block?  invoke this for each exit block?
+//	pred_func_ptr_t func_get_successors=[](const BasicBlock_t* node) -> const BasicBlockSet_t&
+//	{
+//		return node->GetSuccessors();
+//	};
 //	post_dom_graph=Dom_Comp(p_cfg->GetBlocks(), func_get_successors, p_cfg->GetEntry());
 //	post_idom_graph=IDom_Comp(p_cfg->GetBlocks(), post_dom_graph, p_cfg->GetEntry());
 }
@@ -88,7 +88,6 @@ DominatorMap_t DominatorGraph_t::Dom_Comp(const BasicBlockSet_t& N, pred_func_pt
 	Domin(r) := { r } 
 */
 	BasicBlockSet_t D, T;
-	BasicBlock_t* n=NULL, *p=NULL;
 	bool change=true;
 	DominatorMap_t Domin;
 	Domin[r].insert(r);
@@ -219,7 +218,7 @@ end || IDom_Comp
 BlockToBlockMap_t DominatorGraph_t::Idom_Comp(const BasicBlockSet_t& N, const DominatorMap_t &Domin, BasicBlock_t* r) 
 {
 	// n, s, t: Node
-	BasicBlock_t* n=NULL, *s=NULL, *t=NULL;
+	//BasicBlock_t* n=NULL, *s=NULL, *t=NULL;
 
 	// Tmp: Node -> set of Node
 	DominatorMap_t Tmp;
diff --git a/libIRDB/src/core/SConscript b/libIRDB/src/core/SConscript
index 4c9236e0a85dc80fc01164d7b8775adea7a41524..2c45161c39a575d74a1e339ea5e2a08e1fd8ee21 100644
--- a/libIRDB/src/core/SConscript
+++ b/libIRDB/src/core/SConscript
@@ -25,6 +25,8 @@ files=  '''
 	reloc.cpp
 	decode_cs.cpp
 	operand_cs.cpp
+'''
+unused_files='''
 	decode_bea.cpp
 	operand_bea.cpp
 	decode_meta.cpp
@@ -44,7 +46,7 @@ cpppath='''
 
 globs=glob.glob(os.environ['SECURITY_TRANSFORMS_HOME']+'/libcapstone/zipr_unpack/*.o')
 
-myenv.Append(CCFLAGS=" -std=c++11 ")
+myenv.Append(CCFLAGS=" -Wall -std=c++11 ")
 
 myenv=myenv.Clone(CPPPATH=Split(cpppath))
 mylib=myenv.Library(libname, Split(files) + globs)
diff --git a/libIRDB/src/core/decode_cs.cpp b/libIRDB/src/core/decode_cs.cpp
index 01f1c5b2510d0b9e45e981413d6071cf54510eeb..f129fd79a71a0105611c789adcea00c4ca03c3c1 100644
--- a/libIRDB/src/core/decode_cs.cpp
+++ b/libIRDB/src/core/decode_cs.cpp
@@ -206,7 +206,6 @@ DecodedInstructionCapstone_t::DecodedInstructionCapstone_t(const Instruction_t*
 DecodedInstructionCapstone_t::DecodedInstructionCapstone_t(const virtual_offset_t start_addr, const void *data, uint32_t max_len)
 {
 	if(!cs_handle) cs_handle=new CapstoneHandle_t(NULL);
-        const auto endptr=data+max_len;
         Disassemble(start_addr, data, max_len);
 }
 
@@ -589,8 +588,8 @@ virtual_offset_t DecodedInstructionCapstone_t::getMemoryDisplacementOffset(const
 
 	const auto the_insn=static_cast<cs_insn*>(my_insn.get());
 
-	const auto encoding_size=t.getMemoryDisplacementEncodingSize();
-	const auto x86 = &(the_insn->detail->x86);
+	//const auto encoding_size=t.getMemoryDisplacementEncodingSize();
+	//const auto x86 = &(the_insn->detail->x86);
         const auto imm_count = cs_op_count(cs_handle->getHandle(), the_insn, X86_OP_IMM);
 	const auto disp_size=t.getMemoryDisplacementEncodingSize();
 	const auto imm=getImmediate();
diff --git a/libIRDB/src/core/file.cpp b/libIRDB/src/core/file.cpp
index 86719ccec61cfc2dceb7f43178ff6f78412e276a..addefcdf891aa9ad3e24e9b76f7424541f1b3b3c 100644
--- a/libIRDB/src/core/file.cpp
+++ b/libIRDB/src/core/file.cpp
@@ -38,12 +38,22 @@ File_t::File_t(const db_id_t &myfile_id, const db_id_t &my_orig_fid, const std::
                const std::string &ehpgms, const std::string &ehcss, 
 	       const db_id_t &mydoipid) 
 	:
-	BaseObj_t(NULL), url(myurl), hash(myhash), arch(myarch), elfoid(myoid),
-	address_table_name(atn), function_table_name(ftn), instruction_table_name(itn), 
-  	icfs_table_name(icfs), icfs_map_table_name(icfs_map), relocs_table_name(rtn), 
-	types_table_name(typ), scoop_table_name(scoop), 
-	ehpgm_table_name(ehpgms), ehcss_table_name(ehcss), 
-	orig_fid(my_orig_fid)
+	BaseObj_t(NULL), 
+	orig_fid(my_orig_fid),
+	url(myurl), 
+	hash(myhash), 
+	arch(myarch), 
+	address_table_name(atn), 
+	function_table_name(ftn), 
+	instruction_table_name(itn), 
+  	icfs_table_name(icfs), 
+	icfs_map_table_name(icfs_map), 
+	relocs_table_name(rtn), 
+	types_table_name(typ), 
+	scoop_table_name(scoop), 
+	ehpgm_table_name(ehpgms), 
+	ehcss_table_name(ehcss), 
+	elfoid(myoid)
 {
 	SetBaseID(myfile_id);
 }
diff --git a/libIRDB/src/core/fileir.cpp b/libIRDB/src/core/fileir.cpp
index 8abeb4b55e4e960bbf0542590f8f3caaa17832ad..5225664cbdb3ab4271752ef0e624343e305ec019 100644
--- a/libIRDB/src/core/fileir.cpp
+++ b/libIRDB/src/core/fileir.cpp
@@ -194,10 +194,10 @@ void FileIR_t::AssembleRegistry()
 	int rt = system(command.c_str());
 	
 	int actual_exit = -1;
-	int actual_signal = -1;
+	//int actual_signal = -1;
 
 	if (WIFEXITED(rt)) actual_exit = WEXITSTATUS(rt);
-    else actual_signal = WTERMSIG(rt);
+    	//else actual_signal = WTERMSIG(rt);
 
 	assert(actual_exit == 0);
 	
@@ -221,12 +221,10 @@ void FileIR_t::AssembleRegistry()
 	rt = system(command.c_str());
 
 	actual_exit = -1;
-	actual_signal = -1;
+	//actual_signal = -1;
 
-    	if (WIFEXITED(rt)) 
-		actual_exit = WEXITSTATUS(rt);
-    	else 
-		actual_signal = WTERMSIG(rt);
+    	if (WIFEXITED(rt)) actual_exit = WEXITSTATUS(rt);
+    	//else actual_signal = WTERMSIG(rt);
 
 	assert(actual_exit == 0);
 	
@@ -250,7 +248,7 @@ void FileIR_t::AssembleRegistry()
 	binreader.read((char*)binary_stream,filesize);
 	binreader.close();
 
-	unsigned int instr_index = 0;
+	//unsigned int instr_index = 0;
 	//for(unsigned int index=0; index < filesize; instr_index++)
 	unsigned int index = 0;
 	registry_type::iterator reg_val =  assembly_registry.begin();
@@ -277,7 +275,7 @@ void FileIR_t::AssembleRegistry()
 
 		string rawBits;
 		rawBits.resize(instr_len);
-		for(int i=0;i<instr_len;i++,index++)
+		for(auto i=0U;i<instr_len;i++,index++)
 		{
 			rawBits[i] = binary_stream[index];
 		}
@@ -354,12 +352,14 @@ std::map<db_id_t,Function_t*> FileIR_t::ReadFuncsFromDB
 				isSafe = true;
 		}
 
-		db_id_t doipid=atoi(dbintr->GetResultColumn("doip_id").c_str());
+		// handle later?
+		//db_id_t doipid=atoi(dbintr->GetResultColumn("doip_id").c_str());
 
 		FuncType_t* fnType = NULL;
 		if (typesMap.count(function_type_id) > 0)
 			fnType = dynamic_cast<FuncType_t*>(typesMap[function_type_id]);
 		Function_t *newfunc=new Function_t(fid,name,sfsize,oasize,useFP,isSafe,fnType, NULL); 
+		assert(newfunc);
 		entry_points[newfunc]=entry_point_id;
 		
 //std::cout<<"Found function "<<name<<"."<<std::endl;
@@ -530,7 +530,9 @@ std::map<db_id_t,AddressID_t*> FileIR_t::ReadAddrsFromDB
 		db_id_t aid=atoi(dbintr->GetResultColumn("address_id").c_str());
 		db_id_t file_id=atoi(dbintr->GetResultColumn("file_id").c_str());
 		virtual_offset_t vaddr=strtovo(dbintr->GetResultColumn("vaddress_offset"));
-		db_id_t doipid=atoi(dbintr->GetResultColumn("doip_id").c_str());
+
+		// handle later?
+		//db_id_t doipid=atoi(dbintr->GetResultColumn("doip_id").c_str());
 
 		AddressID_t *newaddr=new AddressID_t(aid,file_id,vaddr);
 
@@ -686,7 +688,9 @@ void FileIR_t::ReadRelocsFromDB
                 int reloc_offset=atoi(dbintr->GetResultColumn("reloc_offset").c_str());
                 std::string reloc_type=(dbintr->GetResultColumn("reloc_type"));
                 db_id_t instruction_id=atoi(dbintr->GetResultColumn("instruction_id").c_str());
-                db_id_t doipid=atoi(dbintr->GetResultColumn("doip_id").c_str());
+
+		// handle later?
+                //db_id_t doipid=atoi(dbintr->GetResultColumn("doip_id").c_str());
                 db_id_t wrt_id=atoi(dbintr->GetResultColumn("wrt_id").c_str());
                 uint32_t addend=atoi(dbintr->GetResultColumn("addend").c_str());
 
@@ -976,7 +980,7 @@ int FileIR_t::GetArchitectureBitWidth()
 	return archdesc->GetBitWidth();
 }
 
-int FileIR_t::SetArchitectureBitWidth(int width) 
+void FileIR_t::SetArchitectureBitWidth(int width) 
 {
 	if(archdesc==NULL)
 		archdesc=new ArchitectureDescription_t;
diff --git a/libIRDB/src/core/generate_spri.cpp b/libIRDB/src/core/generate_spri.cpp
index caeda51a244d8af9e8b30a74b63e4322878679f1..c70a735171424d8ae2d8f4a0c1c4b62f0cf85411 100644
--- a/libIRDB/src/core/generate_spri.cpp
+++ b/libIRDB/src/core/generate_spri.cpp
@@ -169,7 +169,7 @@ static string addressify(Instruction_t* insn)
 
 static string URLToFile(string url)
 {
-	int loc=0;
+	auto loc=(size_t)0;
 
 	loc=url.find('/');
 	while(loc!=string::npos)
@@ -289,7 +289,6 @@ void emit_jump(FileIR_t* fileIRp, ostream& fout, const DecodedInstruction_t& dis
 	string label=labelfy(newinsn);
 	string complete_instr=disasm.getDisassembly();
 	string address_string=disasm.getOperand(0).getString();
-	bool converted=false;
 
 
 	/* if we have a target instruction in the database */
@@ -325,7 +324,10 @@ void emit_jump(FileIR_t* fileIRp, ostream& fout, const DecodedInstruction_t& dis
 
 		// if(disasm.Archi==64)
 		if(FileIR_t::GetArchitectureBitWidth()==64)
-			converted=convert_jump_for_64bit(newinsn,final, emit_later,new_target);
+		{
+			auto converted=convert_jump_for_64bit(newinsn,final, emit_later,new_target);
+			(void)converted; // unused?
+		}
 
 		fout<<final<<endl;
 
diff --git a/libIRDB/src/core/instruction.cpp b/libIRDB/src/core/instruction.cpp
index ab6df69d3ba1707b95d5600a43f07038931cfc60..f6ec551cf0a527ed00352e9043e1a48fee706a20 100644
--- a/libIRDB/src/core/instruction.cpp
+++ b/libIRDB/src/core/instruction.cpp
@@ -32,14 +32,14 @@ using namespace std;
 
 Instruction_t::Instruction_t() :
 	BaseObj_t(NULL), 
-	data(""),
-	callback(""),
-	comment(""),
 	my_address(NULL),
 	my_function(NULL),
 	orig_address_id(NOT_IN_DATABASE),
 	fallthrough(NULL),
 	target(NULL),
+	data(""),
+	callback(""),
+	comment(""),
 	indTarg(NULL),
 	icfs(NULL),
 	eh_pgm(NULL),
@@ -59,15 +59,15 @@ Instruction_t::Instruction_t(db_id_t id,
 		db_id_t doip_id) :
 
 	BaseObj_t(NULL), 
-	data(thedata),
-	callback(my_callback),
-	comment(my_comment),
-	indTarg(my_indTarg),
 	my_address(addr),
 	my_function(func),
 	orig_address_id(orig_id),
 	fallthrough(NULL),
 	target(NULL),
+	data(thedata),
+	callback(my_callback),
+	comment(my_comment),
+	indTarg(my_indTarg),
 	icfs(NULL),
 	eh_pgm(NULL),
 	eh_cs(NULL)
@@ -155,7 +155,7 @@ bool Instruction_t::Assemble(string assembly)
 
     string rawBits;
     rawBits.resize(filesize);
-    for (int i = 0; i < filesize; ++i)
+    for (auto i = 0U; i < filesize; ++i)
       rawBits[i] = memblock[i];
 
     // should erase those 2 files here
diff --git a/libIRDB/src/core/operand_cs.cpp b/libIRDB/src/core/operand_cs.cpp
index d2ab8e0f1adb9a9ec5398fd6e1fc1d12d5f63b56..6d824ca665f0f23e488698be3ba2ca8396228fe1 100644
--- a/libIRDB/src/core/operand_cs.cpp
+++ b/libIRDB/src/core/operand_cs.cpp
@@ -23,7 +23,7 @@ static uint32_t to_seg_reg_number(const x86_reg &reg)
 		case X86_REG_DS: return 3;
 		case X86_REG_FS: return 4;
 		case X86_REG_GS: return 5;
-		defaut: assert(0);
+		default: break;
 	}
 	assert(0);
 }
@@ -131,6 +131,7 @@ static uint32_t to_reg_number(const x86_reg &reg)
 		case X86_REG_R15D:
 		case X86_REG_R15W:
 			return 15;
+		default: break;
 	}
 	assert(0);
 }
@@ -413,14 +414,14 @@ bool DecodedOperandCapstone_t::hasMemoryDisplacement() const
 	if(!isMemory()) throw std::logic_error(string("Cannot ")+__FUNCTION__+"  of non-memory operand");
 
 	const auto the_insn = static_cast<cs_insn*>(my_insn.get());
-	const auto &op = (the_insn->detail->x86.operands[op_num]);
+	//const auto &op = (the_insn->detail->x86.operands[op_num]);
 
 	const auto modrm = the_insn->detail->x86.modrm;
 	const auto mod = (modrm >> 6) & 0x3;
 	const auto rm = (modrm & 0x7);
 	const auto sib = the_insn->detail->x86.sib;
 	const auto sib_base = (sib >> 0) & 0x7;
-	const auto sib_index = (sib >> 3) & 0x7;
+	//const auto sib_index = (sib >> 3) & 0x7;
 
 	switch (mod)
 	{
@@ -472,14 +473,14 @@ uint32_t DecodedOperandCapstone_t::getMemoryDisplacementEncodingSize() const
 {
 	if(!isMemory()) throw std::logic_error(string("Cannot ")+__FUNCTION__+"  of non-memory operand");
         const auto the_insn=static_cast<cs_insn*>(my_insn.get());
-        const auto &op = (the_insn->detail->x86.operands[op_num]);
+        //const auto &op = (the_insn->detail->x86.operands[op_num]);
 
 	const auto modrm=the_insn->detail->x86.modrm;
 	const auto mod=(modrm>>6)&0x3;
 	const auto rm=(modrm)&0x7;
 	const auto sib=the_insn->detail->x86.sib;
 	const auto sib_base=(sib>>0)&0x7;
-	const auto sib_index=(sib>>3)&0x7;
+	//const auto sib_index=(sib>>3)&0x7;
 
 	switch(mod)
 	{
diff --git a/libIRDB/src/core/scoop.cpp b/libIRDB/src/core/scoop.cpp
index 80dd9ed63c115e4ccc5465d1747686828a882740..ab50f42c25a4fb485e39f539dff874555ed86c6f 100644
--- a/libIRDB/src/core/scoop.cpp
+++ b/libIRDB/src/core/scoop.cpp
@@ -69,7 +69,7 @@ string DataScoop_t::WriteToDBRange(File_t *fid, db_id_t newid, int start, int en
 
 
         hex_data << query_start << setfill('0') << hex;
-        for (size_t i = start; i < end; ++i)
+        for (auto i = start; i < end; ++i)
 	{
                 hex_data << setw(2) << (int)(contents[i]&0xff);
 
diff --git a/libIRDB/src/core/type.cpp b/libIRDB/src/core/type.cpp
index f7171bae6c90738d8c7adb04c39e933c2a83bb44..7dc8f2a188422dd0ac94fa04cd2af4b9714f3187 100644
--- a/libIRDB/src/core/type.cpp
+++ b/libIRDB/src/core/type.cpp
@@ -84,7 +84,7 @@ string AggregateType_t::WriteToDB(File_t *fid, db_id_t newid)
 
 	string q;
 
-	for (int i = 0; i < GetNumAggregatedTypes(); ++i)
+	for (auto i = 0U; i < GetNumAggregatedTypes(); ++i)
 	{
 		Type_t* t = GetAggregatedType(i);
 		q+=string("insert into ")+fid->types_table_name + 
diff --git a/libIRDB/src/core/variantid.cpp b/libIRDB/src/core/variantid.cpp
index 6b87a2da47fbdaff030d0498c0327ea42803ba31..4daf529f1cc4d7e87a08322aceef47c9250a4014 100644
--- a/libIRDB/src/core/variantid.cpp
+++ b/libIRDB/src/core/variantid.cpp
@@ -110,6 +110,7 @@ bool VariantID_t::Register()
 	BaseObj_t::dbintr->MoveToNextRow();
 	assert(BaseObj_t::dbintr->IsDone());
 
+	return true;
 }    
 
 VariantID_t* VariantID_t::Clone(bool deep)
diff --git a/libIRDB/src/util/params.cpp b/libIRDB/src/util/params.cpp
index 1e4e863a0f3bdee252265ba0671fc0b1784b74e5..de1f604b9b08c2c747201b7725ae689baab094c5 100644
--- a/libIRDB/src/util/params.cpp
+++ b/libIRDB/src/util/params.cpp
@@ -153,7 +153,7 @@ static Instruction_t* IsOrWasCall(const FileIR_t *firp, Instruction_t* insn)
 		}
 	}
 
-	return false;
+	return NULL;
 }
 
 // Does a call follow the instruction?
@@ -170,11 +170,6 @@ bool libIRDB::CallFollows(const FileIR_t *firp, Instruction_t* insn, const strin
 //		auto d=DISASM({0});
 //		Disassemble(ptr,d);
 		const auto d=DecodedInstruction_t(ptr);
-		long long vo = 0;
-		if (ptr->GetAddress())
-			vo = ptr->GetAddress()->GetVirtualOffset();
-//		std::cout << "CallFollows(): " << ptr->getDisassembly() << " @ " << hex << vo << std::endl;
-
 		const auto tgt = IsOrWasCall(firp, ptr);
 
 		if (tgt) 
diff --git a/libIRDB/test/SConscript b/libIRDB/test/SConscript
index a7657d5c51fce17d2dfe218b97f7535f3b2ef59e..8cf229e14659817a22d9d7a72c717b29a6e9d1be 100644
--- a/libIRDB/test/SConscript
+++ b/libIRDB/test/SConscript
@@ -16,19 +16,13 @@ if 'build_tools' not in myenv or myenv['build_tools'] is None or int(myenv['buil
 		 $SECURITY_TRANSFORMS_HOME/libMEDSannotation/include 
 		 $SECURITY_TRANSFORMS_HOME/libEXEIO/include 
 		'''
-#		 $SECURITY_TRANSFORMS_HOME/beaengine/include 
 
 	LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
 	LIBS=Split( 'IRDB-cfg IRDB-util ' + env.subst('$BASE_IRDB_LIBS')+ " MEDSannotation")
 
-	print "The libs for libIRDB/tests are:"
-	print LIBS
-
 	myenv=myenv.Clone(CPPPATH=Split(cpppath))
 
-	myenv.Append(CCFLAGS=" -std=c++11 ")
-	#myenv.Append(CCFLAGS=" -pg ")
-	#myenv.Append(LINKFLAGS=" -pg ")
+	myenv.Append(CCFLAGS=" -std=c++11 -Wall")
 
 	ehframe=myenv.Object("read_ehframe.cpp");
 	split_eh_frame=myenv.Object("split_eh_frame.cpp");
@@ -46,9 +40,10 @@ if 'build_tools' not in myenv or myenv['build_tools'] is None or int(myenv['buil
 	Default(install)
 
 	# most programs go to $sectrans/bin
-	pgms='''print_variant list_programs create_variant create_variantir read_variantir clone 
-		drop_variant generate_spri unfix_calls 
-		find_strings build_callgraph build_preds rename_function pin_address mark_functions_safe
+	pgms='''clone 
+		generate_spri 
+		find_strings 
+		mark_functions_safe
 		'''
 	for i in Split(pgms):
 		# print "Registering pgm: "+ i
diff --git a/libIRDB/test/build_preds.cpp b/libIRDB/test/build_preds.cpp
index 53c6b0874429336f5b9c02b99024481798ecb50b..ae87ac7dc1639cc39f7afb84fafcd993e0ab2c82 100644
--- a/libIRDB/test/build_preds.cpp
+++ b/libIRDB/test/build_preds.cpp
@@ -35,7 +35,7 @@ using namespace std;
 //
 // main routine to build and print a call graph.
 //
-main(int argc, char* argv[])
+int main(int argc, char* argv[])
 {
 	if(argc!=2)
 	{
@@ -99,6 +99,8 @@ main(int argc, char* argv[])
 		
 
 	delete varidp;
+
+	return 0;
 }
 
 
diff --git a/libIRDB/test/check_thunks.cpp b/libIRDB/test/check_thunks.cpp
index d6705b46286777261b5f901bcccbcc86ab273da3..2101ce7273e93f1ddbacd08bc855a9cf8de4147a 100644
--- a/libIRDB/test/check_thunks.cpp
+++ b/libIRDB/test/check_thunks.cpp
@@ -112,8 +112,8 @@ void check_for_thunk_offsets(FileIR_t* firp, Instruction_t *thunk_insn, string r
 
 	virtual_offset_t thunk_base=thunk_insn->GetFallthrough()->GetAddress()->GetVirtualOffset()+
 		strtol(offset.c_str(),NULL,16);
-	virtual_offset_t thunk_call_addr=thunk_insn->GetAddress()->GetVirtualOffset();
-	virtual_offset_t thunk_call_offset=strtol(offset.c_str(),NULL,16);
+	//virtual_offset_t thunk_call_addr=thunk_insn->GetAddress()->GetVirtualOffset();
+	//virtual_offset_t thunk_call_offset=strtol(offset.c_str(),NULL,16);
 
 	/* don't check inserted thunk addresses */
 	if(thunk_insn->GetAddress()->GetVirtualOffset()==0)
@@ -136,8 +136,8 @@ void check_func_for_thunk_offsets(Function_t *func, Instruction_t* thunk_insn,
 
 	virtual_offset_t thunk_base=thunk_insn->GetFallthrough()->GetAddress()->GetVirtualOffset()+
 		strtol(offset.c_str(),NULL,16);
-	virtual_offset_t thunk_call_addr=thunk_insn->GetAddress()->GetVirtualOffset();
-	virtual_offset_t thunk_call_offset=strtol(offset.c_str(),NULL,16);
+	//virtual_offset_t thunk_call_addr=thunk_insn->GetAddress()->GetVirtualOffset();
+	//virtual_offset_t thunk_call_offset=strtol(offset.c_str(),NULL,16);
 
 
 	/* don't check inserted thunk addresses */
diff --git a/libIRDB/test/clone.cpp b/libIRDB/test/clone.cpp
index 6437bb72b0631d3479fc63f32a43b540d7133d5e..73c2525d70043cc3e3dd3a43363248669a8c71e8 100644
--- a/libIRDB/test/clone.cpp
+++ b/libIRDB/test/clone.cpp
@@ -29,7 +29,7 @@
 using namespace libIRDB;
 using namespace std;
 
-main(int argc, char* argv[])
+int main(int argc, char* argv[])
 {
 
 	if(argc!=3)
@@ -83,6 +83,5 @@ main(int argc, char* argv[])
 	delete newpidp;
 	delete pidp;
 
-
-	exit(0);
+	return 0;
 }
diff --git a/libIRDB/test/create_variant.cpp b/libIRDB/test/create_variant.cpp
index 3285af1d4a5aca1e160046b62ad59b624bffffec..98052436e34a3ced2ec237ff235d83117017525e 100644
--- a/libIRDB/test/create_variant.cpp
+++ b/libIRDB/test/create_variant.cpp
@@ -27,7 +27,7 @@
 using namespace libIRDB;
 using namespace std;
 
-main(int argc, char* argv[])
+int main(int argc, char* argv[])
 {
 
 	if(argc!=2)
@@ -74,4 +74,5 @@ main(int argc, char* argv[])
         }
 
 	delete pidp;
+	return 0;
 }
diff --git a/libIRDB/test/create_variantir.cpp b/libIRDB/test/create_variantir.cpp
index 238b7135dbf78db2942b2a2e7ef57eda193e05fa..8a8efe54b05d3df3f3371c68ee9339962ff76b8b 100644
--- a/libIRDB/test/create_variantir.cpp
+++ b/libIRDB/test/create_variantir.cpp
@@ -27,7 +27,7 @@
 using namespace libIRDB;
 using namespace std;
 
-main(int argc, char* argv[])
+int main(int argc, char* argv[])
 {
 
 	if(argc!=2)
@@ -80,4 +80,5 @@ main(int argc, char* argv[])
 
 	delete virp;
 	delete pidp;
+	return 0;
 }
diff --git a/libIRDB/test/drop_variant.cpp b/libIRDB/test/drop_variant.cpp
index 705afa1b1d65bc5c096c864b0b4c716029610a25..14d0dd98d82b1047518294129c23de896c1d7dd8 100644
--- a/libIRDB/test/drop_variant.cpp
+++ b/libIRDB/test/drop_variant.cpp
@@ -27,7 +27,7 @@
 using namespace libIRDB;
 using namespace std;
 
-main(int argc, char* argv[])
+int main(int argc, char* argv[])
 {
 
 	if(argc!=2)
@@ -66,4 +66,5 @@ main(int argc, char* argv[])
 
 	cout<<"Done!"<<endl;
 	delete pidp;
+	return 0;
 }
diff --git a/libIRDB/test/eh_frame.hpp b/libIRDB/test/eh_frame.hpp
index 553e48063f2d6353e80f782a10fd18c3077e085c..d5826f1eb9483f67b058da877b07ebcada86d696 100644
--- a/libIRDB/test/eh_frame.hpp
+++ b/libIRDB/test/eh_frame.hpp
@@ -27,20 +27,20 @@ class eh_frame_util_t
 {
 	public: 
 	template <class T> 
-	static bool read_type(T &value, unsigned int &position, const uint8_t* const data, const int max);
+	static bool read_type(T &value, uint32_t &position, const uint8_t* const data, const uint32_t max);
 	template <class T> 
 	static bool read_type_with_encoding
 		(const uint8_t encoding, T &value, 
-		unsigned int &position, 
+		uint32_t &position, 
 		const uint8_t* const data, 
-		const int max, 
+		const uint32_t max, 
 		const uint64_t section_start_addr );
 
 	static bool read_string 
 		(std::string &s, 
-		unsigned int & position, 
+		uint32_t & position, 
 		const uint8_t* const data, 
-		const int max);
+		const uint32_t max);
 
 
 	// see https://en.wikipedia.org/wiki/LEB128
@@ -59,7 +59,7 @@ class eh_frame_util_t
 	
 	static bool read_length(
 		uint64_t &act_length, 
-		unsigned int &position, 
+		uint32_t &position, 
 		const uint8_t* const data, 
 		const uint32_t max);
 };
diff --git a/libIRDB/test/fill_in_cfg.cpp b/libIRDB/test/fill_in_cfg.cpp
index 443358ed05f7d149d6156825612d664b5cb0aea4..a1d33d216756fd44530fc2ced4008fd24d9404bc 100644
--- a/libIRDB/test/fill_in_cfg.cpp
+++ b/libIRDB/test/fill_in_cfg.cpp
@@ -29,7 +29,6 @@
 #include <ctype.h>
 #include <exeio.h>
 #include "elfio/elfio.hpp"
-#include "elfio/elfio_dump.hpp"
 #include "eh_frame.hpp"
 
 int odd_target_count=0;
@@ -42,7 +41,7 @@ using namespace std;
 using namespace EXEIO;
 
 set< pair<db_id_t,virtual_offset_t> > missed_instructions;
-int failed_target_count=0;
+auto failed_target_count=0U;
 
 pqxxDB_t pqxx_interface;
 
@@ -315,7 +314,7 @@ void add_new_instructions(FileIR_t *firp)
 				/* get the new bits for an instruction */
 				string newinsnbits;
 				newinsnbits.resize(instr_len);
-				for(int i=0;i<instr_len;i++)
+				for(auto i=0U;i<instr_len;i++)
 					newinsnbits[i]=data[offset_into_section+i];
 
 				/* create a new address */
@@ -443,7 +442,7 @@ static bool is_in_relro_segment(const int secndx)
 		return false;
 
 	int segnum = real_elfiop->segments.size();
-	int segndx=0;
+//	int segndx=0;
 
 	virtual_offset_t sec_start=(virtual_offset_t)(elfiop->sections[secndx]->get_address());
 	virtual_offset_t sec_end=(virtual_offset_t)(elfiop->sections[secndx]->get_address() + elfiop->sections[secndx]->get_size() - 1 );
@@ -530,7 +529,7 @@ void fill_in_scoops(FileIR_t *firp)
 		if (elfiop->sections[secndx]->get_data()) 
 			the_contents.assign(elfiop->sections[secndx]->get_data(),elfiop->sections[secndx]->get_size());
 
-		Type_t *chunk_type=NULL; /* FIXME -- need to figure out the type system for scoops, but NULL should remain valid */
+//		Type_t *chunk_type=NULL; /* FIXME -- need to figure out the type system for scoops, but NULL should remain valid */
 
 		/* permissions */
 		int permissions= 
@@ -623,7 +622,7 @@ void parse_args(int argc, char* argv[], bool &fix_landing_pads)
 	}
 }
 
-main(int argc, char* argv[])
+int main(int argc, char* argv[])
 {
 	bool fix_landing_pads = true; // default
 
@@ -673,9 +672,9 @@ main(int argc, char* argv[])
 
 			elfiop=new EXEIO::exeio;
 			assert(elfiop);
-			elfiop->load("readeh_tmp_file.exe");
-			EXEIO::dump::header(cout,*elfiop);
-			EXEIO::dump::section_headers(cout,*elfiop);
+			elfiop->load(string("readeh_tmp_file.exe"));
+			//EXEIO::dump::header(cout,*elfiop);
+			//EXEIO::dump::section_headers(cout,*elfiop);
 
 			fill_in_cfg(firp);
 			fill_in_scoops(firp);
@@ -708,4 +707,5 @@ main(int argc, char* argv[])
 
 	delete pidp;
 	pidp=NULL;
+	return 0;
 }
diff --git a/libIRDB/test/fill_in_indtargs.cpp b/libIRDB/test/fill_in_indtargs.cpp
index 9ef81573d3bc6fce05f1383b78e428a4c6a12bf4..bb64ccaf3e4a85ea15da6f5cc95ac43523da331e 100644
--- a/libIRDB/test/fill_in_indtargs.cpp
+++ b/libIRDB/test/fill_in_indtargs.cpp
@@ -516,7 +516,7 @@ set<Instruction_t*> find_in_function(string needle, Function_t *haystack)
 	assert(0 == regcomp(&preg, needle.c_str(), REG_EXTENDED));
 
 	fit = haystack->GetInstructions().begin();
-	for (fit; fit != haystack->GetInstructions().end(); fit++)
+	for (; fit != haystack->GetInstructions().end(); fit++)
 	{
 		Instruction_t *candidate = *fit;
 		//DISASM disasm;
@@ -649,7 +649,7 @@ I7: 08069391 <_gedit_app_ready+0x91> ret
 	if(!backup_until("mov", I3, I4))
 		return;
 
-	int table_size = 0;
+	auto table_size = 0U;
 	if (!backup_until("cmp", Icmp, I3))
 	{
 		cerr<<"pic32: could not find size of switch table"<<endl;
@@ -700,7 +700,7 @@ I7: 08069391 <_gedit_app_ready+0x91> ret
 		int i;
 		for(i=0;i<3;i++)
 		{
-                	if(offset+i*4+sizeof(int) > pSec->get_size())
+                	if((int)(offset+i*4+sizeof(int)) > (int)pSec->get_size())
                         	break;
 
                 	const int *table_entry_ptr=(const int*)&(secdata[offset+i*4]);
@@ -719,7 +719,7 @@ I7: 08069391 <_gedit_app_ready+0x91> ret
 			// finished the loop.
 			for(i=0;true;i++)
 			{
-                		if(offset+i*4+sizeof(int) > pSec->get_size())
+                		if((int)(offset+i*4+sizeof(int)) > (int)pSec->get_size())
                         		break;
 	
                 		const int32_t *table_entry_ptr=(const int32_t*)&(secdata[offset+i*4]);
@@ -815,7 +815,7 @@ cout<<hex<<"Found (type2) switch dispatch at "<<I3->GetAddress()->GetVirtualOffs
 	/* iterate over all thunk_bases/module_starts */
 	for(set<virtual_offset_t>::iterator it=thunk_bases.begin(); it!=thunk_bases.end(); ++it)
 	{
-		virtual_offset_t thunk_base=*it;
+		//virtual_offset_t thunk_base=*it;
 		virtual_offset_t table_base=*it+table_offset;
 
 		// find the section with the data table
@@ -833,7 +833,7 @@ cout<<hex<<"Found (type2) switch dispatch at "<<I3->GetAddress()->GetVirtualOffs
 		int i;
 		for(i=0;i<3;i++)
 		{
-                	if(offset+i*4+sizeof(int) > pSec->get_size())
+                	if((int)(offset+i*4+sizeof(int)) > (int)pSec->get_size())
                         	break;
 
                 	const int32_t *table_entry_ptr=(const int32_t*)&(secdata[offset+i*4]);
@@ -851,7 +851,7 @@ cout<<hex<<"Found (type2) switch dispatch at "<<I3->GetAddress()->GetVirtualOffs
 			// finished the loop.
 			for(i=0;true;i++)
 			{
-                		if(offset+i*4+sizeof(int) > pSec->get_size())
+                		if((int)(offset+i*4+sizeof(int)) > (int)pSec->get_size())
                         		break;
 	
                 		const int32_t *table_entry_ptr=(const int32_t*)&(secdata[offset+i*4]);
@@ -885,33 +885,27 @@ cout<<hex<<"Found (type2) switch dispatch at "<<I3->GetAddress()->GetVirtualOffs
  */
 static void check_for_PIC_switch_table32_type3(FileIR_t* firp, Instruction_t* insn, DecodedInstruction_t disasm, EXEIO::exeio* elfiop, const set<virtual_offset_t> &thunk_bases)
 {
-	int ptrsize=firp->GetArchitectureBitWidth()/8;
+	uint32_t ptrsize=firp->GetArchitectureBitWidth()/8;
 	ibt_provenance_t prov=ibt_provenance_t::ibtp_switchtable_type3;
 
         Instruction_t* I5=insn;
         // check if I5 is a jump
-        //if(strstr(disasm.Instruction.Mnemonic, "jmp")==NULL)
         if(strstr(disasm.getMnemonic().c_str()/*Instruction.Mnemonic*/, "jmp")==NULL)
 		return;
 
 	// return if it's not a jump to a memory address
-        //if(!(disasm.Argument1.ArgType&MEMORY_TYPE))
         if(!(disasm.getOperand(0).isMemory()))
 		return;
 
 	/* return if there's no displacement */
-        //if(disasm.Argument1.Memory.Displacement==0)
         if(disasm.getOperand(0).getMemoryDisplacement()==0)
 		return;
 
-        //if(disasm.Argument1.Memory.Scale!=ptrsize)
-        // if(disasm.getOperand(0).getScaleValue()!=ptrsize)
         if(!disasm.getOperand(0).hasIndexRegister() || disasm.getOperand(0).getScaleValue()!=ptrsize)
 		return;
 
 	// grab the table base out of the jmp.
 	virtual_offset_t table_base=disasm.getOperand(0).getMemoryDisplacement();//disasm.Argument1.Memory.Displacement;
-        //if((disasm.Argument1.ArgType&RELATIVE_))
         if(disasm.getOperand(0).isPcrel())
 		table_base+=insn->GetDataBits().size()+insn->GetAddress()->GetVirtualOffset();
 
@@ -955,7 +949,7 @@ static void check_for_PIC_switch_table32_type3(FileIR_t* firp, Instruction_t* in
 		for(i=0;true;i++)
 		{
 			
-			if(offset+i*ptrsize+ptrsize > pSec->get_size())
+			if((int)(offset+i*ptrsize+ptrsize) > (int)pSec->get_size())
 				return;
 
 			const void *table_entry_ptr=(const int*)&(secdata[offset+i*ptrsize]);
@@ -988,10 +982,10 @@ static void check_for_PIC_switch_table32_type3(FileIR_t* firp, Instruction_t* in
 	}
 	
 
-	int i;
+	auto i=0U;
 	for(i=0;i<3;i++)
 	{
-		if(offset+i*ptrsize+ptrsize > pSec->get_size())
+		if((int)(offset+i*ptrsize+ptrsize) > (int)pSec->get_size())
 			return;
 
 		const void *table_entry_ptr=(const int*)&(secdata[offset+i*ptrsize]);
@@ -1074,7 +1068,7 @@ static void check_for_PIC_switch_table32_type3(FileIR_t* firp, Instruction_t* in
 				}
 				jmptables[insn].SetAnalysisStatus(ICFS_Analysis_Complete);
 			}
-			if(offset+i*ptrsize+ptrsize > pSec->get_size() || i > table_max)
+			if((int)(offset+i*ptrsize+ptrsize) > (int)pSec->get_size() || i > table_max)
 				return;
 
 			const void *table_entry_ptr=(const int*)&(secdata[offset+i*ptrsize]);
@@ -1125,7 +1119,7 @@ I1:   0x000000000044425a <+218>:        cmp    DWORD PTR [rax+0x8],0xd   // boun
 I2:   0x000000000044425e <+222>:        jbe    0x444320 <_gedit_tab_get_icon+416>
 <new bb>
 I3:   0x0000000000444264 <+228>:        mov    rdi,rbp // default case, also jumped to via indirect branch below
-<snip (doesn't fall through)>
+<snip (doesnt fall through)>
 I4:   0x0000000000444320 <+416>:        mov    edx,DWORD PTR [rax+0x8]		# load from memory into index reg EDX.
 
 THIS ONE
@@ -1156,7 +1150,7 @@ I5-2   	0x00000000000b93bf <+59>:	lea    rax,[rip+0x1f33a]        # 0xd8700
    	0x00000000000b93c6 <+66>:	add    rax,rdx
    	0x00000000000b93c9 <+69>:	jmp    rax
 
-Note: Since I6 doesn't access memory, do another backup until with to verify address format 
+Note: Since I6 doesnt access memory, do another backup until with to verify address format 
 
 Alternate version 2:
 
@@ -1327,7 +1321,7 @@ Note: Here the operands of the add are reversed, so lookup code was not finding
 	 * Check each one that is returned.
 	 */
 	found_leas_it = found_leas.begin();
-	for (found_leas_it; found_leas_it != found_leas.end(); found_leas_it++) 
+	for (; found_leas_it != found_leas.end(); found_leas_it++) 
 	{
 		Instruction_t *I5_cur = *found_leas_it;
 		//Disassemble(I5_cur,disasm);
@@ -1361,7 +1355,7 @@ Note: Here the operands of the add are reversed, so lookup code was not finding
 			//return;
 			continue;
 
-		int table_size = 0;
+		auto table_size = 0U;
 		if(backup_until(cmp_str.c_str(), I1, I8))
 		{
 			//DISASM d1;
@@ -1399,12 +1393,12 @@ Note: Here the operands of the add are reversed, so lookup code was not finding
 
 		set<Instruction_t *> ibtargets;
 		virtual_offset_t offset=D1-pSec->get_address();
-		int entry=0;
+		auto entry=0U;
 		auto found_table_error = false;
 		do
 		{
 			// check that we can still grab a word from this section
-			if(offset+sizeof(int) > pSec->get_size())
+			if((int)(offset+sizeof(int)) > (int)pSec->get_size())
 			{
 				found_table_error = true;
 				break;
@@ -1540,12 +1534,12 @@ static void check_for_nonPIC_switch_table_pattern2(FileIR_t* firp, Instruction_t
 
 	// get the base offset into the section
     	virtual_offset_t offset=table_offset-pSec->get_address();
-	int i;
+	auto i=0U;
 
 	set<Instruction_t*> ibtargets;
 	for(i=0;i<table_size;++i)
 	{
-		if(offset+i*arch_ptr_bytes()+sizeof(int) > pSec->get_size())
+		if((int)(offset+i*arch_ptr_bytes()+sizeof(int)) > (int)pSec->get_size())
 		{
 			cout << "jmp table outside of section range ==> invalid switch table" << endl;
 			return;
@@ -1591,7 +1585,7 @@ static void check_for_nonPIC_switch_table(FileIR_t* firp, Instruction_t* insn, D
 {
 	ibt_provenance_t prov=ibt_provenance_t::ibtp_switchtable_type6;
 	Instruction_t *I1 = NULL;
-	Instruction_t *I2 = NULL;
+	//Instruction_t *I2 = NULL;
 	Instruction_t *I4 = NULL;
 	Instruction_t *IJ = insn;
 
@@ -1663,7 +1657,7 @@ static void check_for_nonPIC_switch_table(FileIR_t* firp, Instruction_t* insn, D
 
 	// get the base offset into the section
 	virtual_offset_t offset=table_offset-pSec->get_address();
-	int i;
+	auto i=0U;
 
 	if(getenv("IB_VERBOSE"))
 		cout << hex << "offset: " << offset << " arch bit width: " << dec << firp->GetArchitectureBitWidth() << endl;
@@ -1671,7 +1665,7 @@ static void check_for_nonPIC_switch_table(FileIR_t* firp, Instruction_t* insn, D
 	set<Instruction_t*> ibtargets;
 	for(i=0;i<table_size;++i)
 	{
-		if(offset+i*arch_ptr_bytes()+sizeof(int) > pSec->get_size())
+		if((int)(offset+i*arch_ptr_bytes()+sizeof(int)) > (int)pSec->get_size())
 		{
 			cout << "jmp table outside of section range ==> invalid switch table" << endl;
 			return;
@@ -1907,12 +1901,12 @@ void read_stars_xref_file(FileIR_t* firp)
 
 void process_dynsym(FileIR_t* firp)
 {
-	FILE *dynsymfile = popen("$PS_OBJDUMP -T readeh_tmp_file.exe | $PS_GREP '^[0-9]\\+' | $PS_GREP -v UND | awk '{print $1;}' | $PS_GREP -v '^$'", "r");
+	auto dynsymfile = popen("$PS_OBJDUMP -T readeh_tmp_file.exe | $PS_GREP '^[0-9]\\+' | $PS_GREP -v UND | awk '{print $1;}' | $PS_GREP -v '^$'", "r");
 	assert(dynsymfile);
-	virtual_offset_t target=0;
+	auto target=(unsigned int)0;
 	while( fscanf(dynsymfile, "%x", &target) != -1)
 	{
-		possible_target(target,0,ibt_provenance_t::ibtp_dynsym);
+		possible_target((virtual_offset_t)target,0,ibt_provenance_t::ibtp_dynsym);
 	}
 }
 
@@ -2268,13 +2262,13 @@ void unpin_elf_tables(FileIR_t *firp, int64_t do_unpin_opt)
 		const char *scoop_contents=scoop->GetContents().c_str();
 		if(scoop->GetName()==".init_array" || scoop->GetName()==".fini_array" || scoop->GetName()==".got.plt" || scoop->GetName()==".got")
 		{
-			int start_offset=0;
+			auto start_offset=0U;
 			if(scoop->GetName()==".got.plt")
 			{
 				// .got.plt has a start index of 4 pointers into the section.
 				start_offset=4*ptrsize;
 			}
-			for(int i=start_offset; i+ptrsize <= scoop->GetSize() ; i+=ptrsize)
+			for(auto i=start_offset; i+ptrsize <= scoop->GetSize() ; i+=ptrsize)
 			{
 				virtual_offset_t vo;
 				if(ptrsize==4)
@@ -2380,8 +2374,8 @@ void unpin_elf_tables(FileIR_t *firp, int64_t do_unpin_opt)
 					assert(0);
 				
 			}
-			int table_entry_no=0;
-			for(int i=0;i+symsize<scoop->GetSize(); i+=symsize, table_entry_no++)
+			auto table_entry_no=0U;
+			for(auto i=0U;i+symsize<scoop->GetSize(); i+=symsize, table_entry_no++)
 			{
 				int addr_offset=0;
 				virtual_offset_t vo=0;
@@ -2782,7 +2776,7 @@ void fill_in_indtargs(FileIR_t* firp, exeio* elfiop, std::list<virtual_offset_t>
 }
 
 
-main(int argc, char* argv[])
+int main(int argc, char* argv[])
 {
 	auto argc_iter = (int)2;
 	auto split_eh_frame_opt=true;
@@ -2886,7 +2880,7 @@ main(int argc, char* argv[])
 		        pqxx::largeobject lo(elfoid);
         		lo.to_file(pqxx_interface.GetTransaction(),"readeh_tmp_file.exe");
         		EXEIO::exeio*    elfiop=new EXEIO::exeio;
-        		elfiop->load((const char*)"readeh_tmp_file.exe");
+        		elfiop->load(string("readeh_tmp_file.exe"));
 
 			// find all indirect branch targets
 			fill_in_indtargs(firp, elfiop, forced_pins, do_unpin_opt);
@@ -2911,4 +2905,5 @@ main(int argc, char* argv[])
 	assert(firp && pidp);
 
 	delete pidp;
+	return 0;
 }
diff --git a/libIRDB/test/find_strings.cpp b/libIRDB/test/find_strings.cpp
index e131408912133ccc2805ab083a718126ca799e00..5f9ee4a8e24bda4009625ea4f502174bab1c22bc 100644
--- a/libIRDB/test/find_strings.cpp
+++ b/libIRDB/test/find_strings.cpp
@@ -31,10 +31,15 @@
 
 #include <exeio.h>
 
-#include <elf.h>
+//#include <elf.h>
 #include "targ-config.h"
 #include "elfio/elfio.hpp"
-#include "elfio/elfio_dump.hpp"
+//#include "elfio/elfio_dump.hpp"
+
+// elfio doesn't have this, and elf.h does, but including both is troublesome.
+#ifndef SHT_GNU_HASH
+#define SHT_GNU_HASH	  0x6ffffff6
+#endif
 
 
 
@@ -42,7 +47,7 @@ using namespace libIRDB;
 using namespace std;
 using namespace EXEIO;
 
-#define arch_ptr_bytes() (firp->GetArchitectureBitWidth()/8)
+#define arch_ptr_bytes() (uintptr_t)(firp->GetArchitectureBitWidth()/8)
 
 bool is_string_character(char c)
 {
@@ -76,7 +81,7 @@ void found_string(string s, void* addr)
 	do {
 		// look for new lines in the string
 		// if found, split it up and print out each one as it's own thing.
-		while(p=strchr(old_p,'\n'))
+		while( ( p=strchr(old_p,'\n')) )
 		{
 			*p=0;
 			if (*old_p != 0)
@@ -131,7 +136,7 @@ void check_for_string(const char* p, void* addr)
 
 void is_string_pointer(void* addr, elf_info_t &ei)
 {
-	long long int intaddr=(long long int)(addr);
+	auto intaddr=(uintptr_t)(addr);
 
 	for(int i=0;i<ei.secnum;i++)
 	{
@@ -159,8 +164,9 @@ void is_string_constant(const DecodedInstruction_t& disasm)
 
 	//if(disasm.Argument1.ArgType != MEMORY_TYPE || disasm.Argument2.ArgType == MEMORY_TYPE
 	//   || disasm.Argument1.ArgSize != FileIR_t::GetArchitectureBitWidth() )
-	if(!disasm.getOperand(0).isMemory() || disasm.getOperand(1).isMemory() 
-	   || disasm.getOperand(0).getArgumentSizeInBits() != FileIR_t::GetArchitectureBitWidth() )
+	if(!disasm.getOperand(0).isMemory() || 
+	   disasm.getOperand(1).isMemory() || 
+	   (uintptr_t)disasm.getOperand(0).getArgumentSizeInBits() != (uintptr_t)FileIR_t::GetArchitectureBitWidth() )
 		return;
 
 	// addr = (void*)disasm.Instruction.Immediat;
@@ -479,8 +485,8 @@ void find_strings_in_data(FileIR_t* firp, elf_info_t& ei)
 		    || the_elfiop->sections[i]->get_size() < arch_ptr_bytes())
 			continue;
 
-		int offset = 0;
-		int step;
+		auto offset = 0U;
+		auto step = 0U;
 		/* step over relocation info */
 		switch( the_elfiop->sections[i]->get_type() )
 		{
@@ -514,7 +520,7 @@ void find_strings_in_data(FileIR_t* firp, elf_info_t& ei)
 		}
 
 		load_section(ei,i,true);
-        	for(int j=offset;j+arch_ptr_bytes()<=ei.elfiop->sections[i]->get_size();j+=step)
+        	for(auto j=offset;(uintptr_t)(j+arch_ptr_bytes())<=(uintptr_t)(ei.elfiop->sections[i]->get_size());j+=step)
         	{
 			void* p;
 			if(arch_ptr_bytes()==4)
@@ -543,9 +549,9 @@ void find_strings(VariantID_t *pidp, FileIR_t* firp)
 	pqxx::largeobject lo(elfoid);
 	lo.to_file(pqxx_interface->GetTransaction(),"readeh_tmp_file.exe");
 	EXEIO::exeio    elfiop;
-	elfiop.load("readeh_tmp_file.exe");
-	EXEIO::dump::header(cout,elfiop);
-	EXEIO::dump::section_headers(cout,elfiop);
+	elfiop.load(string("readeh_tmp_file.exe"));
+	//EXEIO::dump::header(cout,elfiop);
+	//EXEIO::dump::section_headers(cout,elfiop);
 
 
 
@@ -562,7 +568,7 @@ void find_strings(VariantID_t *pidp, FileIR_t* firp)
 	cout << "# ATTRIBUTE filename="<<firp->GetFile()->GetURL()<<endl;
 }
 
-main(int argc, char* argv[])
+int main(int argc, char* argv[])
 {
 
 	if(argc!=2)
@@ -618,5 +624,6 @@ main(int argc, char* argv[])
 	cout<<"Done!"<<endl;
 
 	delete pidp;
+	return 0;
 }
 
diff --git a/libIRDB/test/fix_calls.cpp b/libIRDB/test/fix_calls.cpp
index 734d09317b5f3ccf27cc6fbdfaf076d3a4ce9797..92b126479044e1b2979c2d3cf58d2b80e1f8fdf2 100644
--- a/libIRDB/test/fix_calls.cpp
+++ b/libIRDB/test/fix_calls.cpp
@@ -398,8 +398,8 @@ string adjust_esp_offset(string newbits, int offset)
 
         int sib_byte=(unsigned char)newbits[2];
         int sib_base=(unsigned char)sib_byte&0x7;
-        int sib_ss=(sib_byte>>3)&0x7;
-        int sib_index=(sib_byte>>3)&0x7;
+        //int sib_ss=(sib_byte>>3)&0x7;
+        //int sib_index=(sib_byte>>3)&0x7;
 
 
         /* 32-bit offset */
@@ -554,14 +554,14 @@ void fix_call(Instruction_t* insn, FileIR_t *firp, bool can_unpin)
 {
 	/* record the possibly new indirect branch target if this call gets fixed */
 	Instruction_t* newindirtarg=insn->GetFallthrough();
-	bool has_rex=false;
+	//bool has_rex=false;
 
 	/* disassemble */
         //DISASM disasm;
 	DecodedInstruction_t disasm(insn);
 
         /* Disassemble the instruction */
-        int instr_len = disasm.length(); // Disassemble(insn,disasm);
+        //int instr_len = disasm.length(); // Disassemble(insn,disasm);
 
 
 	/* if this instruction is an inserted call instruction than we don't need to 
@@ -575,8 +575,10 @@ void fix_call(Instruction_t* insn, FileIR_t *firp, bool can_unpin)
 	 */
 	if((insn->GetDataBits()[0]&0x40)==0x40)
 	{
+#if 0
 		// has rex!
 		has_rex=true;
+#endif
 	}
 	else if( (insn->GetDataBits()[0]!=(char)0xff) && 
 		 (insn->GetDataBits()[0]!=(char)0xe8) && 
@@ -744,28 +746,6 @@ bool can_skip_safe_function(Instruction_t *call_insn)
 	return func->IsSafe();
 }
 
-static File_t* find_file(FileIR_t* firp, db_id_t fileid)
-{
-#if 0
-        set<File_t*> &files=firp->GetFiles();
-
-        for(
-                set<File_t*>::iterator it=files.begin();
-                it!=files.end();
-                ++it
-           )
-        {
-                File_t* thefile=*it;
-                if(thefile->GetBaseID()==fileid)
-                        return thefile;
-        }
-        return NULL;
-#endif
-        assert(firp->GetFile()->GetBaseID()==fileid);
-        return firp->GetFile();
-
-}
-
 
 template <class T> struct insn_less : binary_function <T,T,bool> {
   bool operator() (const T& x, const T& y) const {
@@ -906,7 +886,7 @@ void fix_other_pcrel(FileIR_t* firp, Instruction_t *insn, uintptr_t virt_offset)
 	const bool is_rel= relop_it!=operands.end(); 
 
 	/* if this has already been fixed, we can skip it */
-	if(virt_offset==0 || virt_offset==-1)
+	if(virt_offset==0 || virt_offset==(uintptr_t)-1)
 		return;
 
 	if(is_rel)
@@ -941,7 +921,7 @@ void fix_other_pcrel(FileIR_t* firp, Instruction_t *insn, uintptr_t virt_offset)
 		uintptr_t oldpc=virt_offset;
 		uintptr_t newdisp=disp+oldpc;
 
-		assert(offset+size<=data.length());
+		assert((uintptr_t)(offset+size)<=(uintptr_t)(data.length()));
 		
 		switch(size)
 		{
@@ -953,7 +933,8 @@ void fix_other_pcrel(FileIR_t* firp, Instruction_t *insn, uintptr_t virt_offset)
 			case 2:
 			case 8:
 			default:
-				assert(("Cannot handle offset of given size", 0));
+				assert(0);
+				//assert(("Cannot handle offset of given size", 0));
 		}
 
 		/* put the data back into the insn */
@@ -979,7 +960,7 @@ void fix_other_pcrel(FileIR_t* firp, Instruction_t *insn, uintptr_t virt_offset)
 void fix_safefr(FileIR_t* firp, Instruction_t *insn, uintptr_t virt_offset)
 {
 	/* if this has already been fixed, we can skip it */
-	if(virt_offset==0 || virt_offset==-1)
+	if(virt_offset==0 || virt_offset==(uintptr_t)-1)
 		return;
 
 	for(set<Relocation_t*>::iterator it=insn->GetRelocations().begin();
@@ -1017,7 +998,7 @@ void fix_other_pcrel(FileIR_t* firp)
 //
 // main rountine; convert calls into push/jump statements 
 //
-main(int argc, char* argv[])
+int main(int argc, char* argv[])
 {
 
 	bool fix_all=false;
@@ -1111,7 +1092,7 @@ main(int argc, char* argv[])
                         pqxx::largeobject lo(elfoid);
                         lo.to_file(pqxx_interface.GetTransaction(),"readeh_tmp_file.exe");
                         EXEIO::exeio*    elfiop=new EXEIO::exeio;
-                        elfiop->load((const char*)"readeh_tmp_file.exe");
+                        elfiop->load(string("readeh_tmp_file.exe"));
                         EXEIO::dump::header(cout,*elfiop);
                         EXEIO::dump::section_headers(cout,*elfiop);
 			// do eh_frame reading as required. 
@@ -1138,6 +1119,7 @@ main(int argc, char* argv[])
         }
 
 	delete pidp;
+	return 0;
 }
 
 
@@ -1164,5 +1146,6 @@ void range(virtual_offset_t a, virtual_offset_t b)
 bool possible_target(uintptr_t p, uintptr_t at, ibt_provenance_t prov)
 {
 	// used for LDSA
+	return false;
 }
 
diff --git a/libIRDB/test/generate_spri.cpp b/libIRDB/test/generate_spri.cpp
index 4f287dfa2d712cae92cd8843fd3fd5d9315920d7..6c60fa7deeb3e331c9583b9de58d02832ba1ea7f 100644
--- a/libIRDB/test/generate_spri.cpp
+++ b/libIRDB/test/generate_spri.cpp
@@ -34,7 +34,7 @@ using namespace std;
 //
 // main routine to generate spri rules for a variant.
 //
-main(int argc, char* argv[])
+int main(int argc, char* argv[])
 {
 	if(argc!=3 && argc!=4)
 	{
@@ -101,6 +101,7 @@ main(int argc, char* argv[])
 		
 
 	delete varidp;
+	return 0;
 }
 
 
diff --git a/libIRDB/test/ilr.cpp b/libIRDB/test/ilr.cpp
index f7dff5d2d27fd406a402d9b0bac33fbad1c2d941..74d047d281eb2a9a5845892b40ecdba509f9e491 100644
--- a/libIRDB/test/ilr.cpp
+++ b/libIRDB/test/ilr.cpp
@@ -120,7 +120,7 @@ void do_ilr(VariantID_t *pidp, FileIR_t* firp)
 	cout<<"Writing variant "<<*pidp<<" back to database." << endl;
 	firp->WriteToDB();
 }
-main(int argc, char* argv[])
+int main(int argc, char* argv[])
 {
 
 	if(argc!=2)
@@ -178,5 +178,6 @@ main(int argc, char* argv[])
 	cout<<"Done!"<<endl;
 
 	delete pidp;
+	return 0;
 }
 
diff --git a/libIRDB/test/list_programs.cpp b/libIRDB/test/list_programs.cpp
index 1b4cd5ddeb287b2729692eb6e611ab4e3636c683..ede92ba86e328b0b14c9f85f6e1a1b170cc1fcae 100644
--- a/libIRDB/test/list_programs.cpp
+++ b/libIRDB/test/list_programs.cpp
@@ -27,7 +27,7 @@
 using namespace libIRDB;
 using namespace std;
 
-main(int argc, char* argv[])
+int main(int argc, char* argv[])
 {
 
 	if(argc!=1)
@@ -60,5 +60,5 @@ main(int argc, char* argv[])
 			}
 		};
 	}
-
+	return 0;
 }
diff --git a/libIRDB/test/mark_functions_safe.cpp b/libIRDB/test/mark_functions_safe.cpp
index 13a74f26c2cb8d26e3708ae324aa3b673620f0e4..7e27bd7b85cd61fbb6cd36249c8fa51c12c35e8a 100644
--- a/libIRDB/test/mark_functions_safe.cpp
+++ b/libIRDB/test/mark_functions_safe.cpp
@@ -69,7 +69,7 @@ void mark_function_safe(FileIR_t* firp, const std::string& function_file)
 	firp->WriteToDB();
 }
 
-main(int argc, char* argv[])
+int main(int argc, char* argv[])
 {
 	if(argc!=3)
 	{
@@ -120,5 +120,6 @@ main(int argc, char* argv[])
 	cout<<"Done!"<<endl;
 
 	delete pidp;
+	return 0;
 }
 
diff --git a/libIRDB/test/pin_address.cpp b/libIRDB/test/pin_address.cpp
index f765e1f0b29029853eaa6ee96b63676533527d1b..dc4fc637433461632f9c32a659205d5590232dc3 100644
--- a/libIRDB/test/pin_address.cpp
+++ b/libIRDB/test/pin_address.cpp
@@ -43,7 +43,7 @@ unsigned long pa_strtoul(const char * const number)
 	 * Determine the base.
 	 */
 	if (number_len >= 2 && number[0] == '0' && 
-	   (number[1] == 'x') || (number[1] == 'X'))
+	   ((number[1] == 'x') || (number[1] == 'X')))
 		base = 16;
 	else if (number_len >= 1 && number[0] == '0')
 		base = 8;
@@ -59,7 +59,7 @@ unsigned long pa_strtoul(const char * const number)
 	}
 }
 
-main(int argc, char* argv[])
+int main(int argc, char* argv[])
 {
 	VariantID_t *pidp=NULL;
 	FileIR_t * firp=NULL;
@@ -141,4 +141,5 @@ main(int argc, char* argv[])
 	assert(firp && pidp);
 
 	delete pidp;
+	return 0;
 }
diff --git a/libIRDB/test/print_variant.cpp b/libIRDB/test/print_variant.cpp
index 68fb29aace6e83d745b3b56737df84ee1a376d68..b45f283fb732bed65efb8e2e97886c7b4a6dcc90 100644
--- a/libIRDB/test/print_variant.cpp
+++ b/libIRDB/test/print_variant.cpp
@@ -28,7 +28,7 @@ using namespace libIRDB;
 using namespace std;
 
 
-main(int argc, char* argv[])
+int main(int argc, char* argv[])
 {
 
 	if(argc!=2)
@@ -65,4 +65,5 @@ main(int argc, char* argv[])
 	cout<<"Variant "<< argv[1]<< " found in db: "<<*pidp << endl;
 
 	delete pidp;
+	return 0;
 }
diff --git a/libIRDB/test/read_ehframe.cpp b/libIRDB/test/read_ehframe.cpp
index ebe7b9491ff43fe906e3a03691ff059af15af265..fa4186d57a69fc40be7d51c7dad7e1641ea6f018 100644
--- a/libIRDB/test/read_ehframe.cpp
+++ b/libIRDB/test/read_ehframe.cpp
@@ -20,7 +20,6 @@
  *
  */
 
-int ptrsize=0;
 
 
 #include <libIRDB-core.hpp>
@@ -32,9 +31,12 @@ int ptrsize=0;
 #include <string.h>
 
 #include <exeio.h>
-#include "targ-config.h"
+
+// disable sign compare warnings in 3rd party code 
+#pragma GCC diagnostic ignored "-Wsign-compare"
 #include "elfio/elfio.hpp"
 #include "elfio/elfio_dump.hpp"
+#pragma GCC diagnostic pop
 
 
 #include "fill_in_indtargs.hpp"
@@ -48,6 +50,7 @@ using namespace std;
 
 
 
+uint32_t ptrsize=0;
 ELFIO::elfio *elfiop=NULL;
 void* eh_frame_addr=0;
 char* eh_frame_data=0;
@@ -268,28 +271,6 @@ struct lsda_header_info
 
 
 
-static File_t* find_file(FileIR_t* virp, db_id_t fileid)
-{
-#if 0
-        set<File_t*> &files=virp->GetFiles();
-
-        for(
-                set<File_t*>::iterator it=files.begin();
-                it!=files.end();
-                ++it
-           )
-        {
-                File_t* thefile=*it;
-                if(thefile->GetBaseID()==fileid)
-                        return thefile;
-        }
-        return NULL;
-#endif
-        assert(virp->GetFile()->GetBaseID()==fileid);
-        return virp->GetFile();
-
-}
-
 struct object *all_objects=NULL;
 
 void register_frame_info(void *begin, struct object *ob)
@@ -881,8 +862,8 @@ void read_ehframe(FileIR_t* virp, EXEIO::exeio* exeiop)
 
 	int secndx=0;
 	int secnum=elfiop->sections.size(); 
-	ELFIO::Elf_Half strndx = elfiop->get_section_name_str_index();
-	const char* strtab=elfiop->sections[strndx]->get_data();
+	//ELFIO::Elf_Half strndx = elfiop->get_section_name_str_index();
+	//const char* strtab=elfiop->sections[strndx]->get_data();
 
        	/* Locate desired section */
        	bool found=false;
diff --git a/libIRDB/test/read_variantir.cpp b/libIRDB/test/read_variantir.cpp
index 3a7223350f5358245a45162ca37533dd6f2ac532..18aaf555d3e5a0f4a5a5699567905929fa6db6fc 100644
--- a/libIRDB/test/read_variantir.cpp
+++ b/libIRDB/test/read_variantir.cpp
@@ -28,7 +28,7 @@
 using namespace libIRDB;
 using namespace std;
 
-main(int argc, char* argv[])
+int main(int argc, char* argv[])
 {
 
 	if(argc!=2)
@@ -120,4 +120,5 @@ main(int argc, char* argv[])
 		exit(-1);
 	}
 
+	return 0;
 }
diff --git a/libIRDB/test/split_eh_frame.cpp b/libIRDB/test/split_eh_frame.cpp
index a25a315da5ae49908caf743afdab3a847ecb5e31..946883786e61206aa3708b7c80bb44c921026f18 100644
--- a/libIRDB/test/split_eh_frame.cpp
+++ b/libIRDB/test/split_eh_frame.cpp
@@ -24,7 +24,7 @@ using namespace libIRDB;
 
 template <int ptrsize>
 template <class T> 
-bool eh_frame_util_t<ptrsize>::read_type(T &value, unsigned int &position, const uint8_t* const data, const int max)
+bool eh_frame_util_t<ptrsize>::read_type(T &value, uint32_t &position, const uint8_t* const data, const uint32_t max)
 {
 	if(position + sizeof(T) > max) return true;
 
@@ -43,9 +43,9 @@ template <int ptrsize>
 template <class T> 
 bool eh_frame_util_t<ptrsize>::read_type_with_encoding
 	(const uint8_t encoding, T &value, 
-	unsigned int &position, 
+	uint32_t &position, 
 	const uint8_t* const data, 
-	const int max, 
+	const uint32_t max, 
 	const uint64_t section_start_addr )
 {
 	auto orig_position=position;
@@ -167,9 +167,9 @@ bool eh_frame_util_t<ptrsize>::read_type_with_encoding
 template <int ptrsize>
 bool eh_frame_util_t<ptrsize>::read_string 
 	(string &s, 
-	unsigned int & position, 
+	uint32_t & position, 
 	const uint8_t* const data, 
-	const int max)
+	const uint32_t max)
 {
 	while(data[position]!='\0' && position < max)
 	{
@@ -235,7 +235,7 @@ bool eh_frame_util_t<ptrsize>::read_sleb128 (
 template <int ptrsize>
 bool eh_frame_util_t<ptrsize>::read_length(
 	uint64_t &act_length, 
-	unsigned int &position, 
+	uint32_t &position, 
 	const uint8_t* const data, 
 	const uint32_t max)
 {
@@ -742,7 +742,7 @@ bool eh_program_insn_t<ptrsize>::Advance(uint64_t &cur_addr, uint64_t CAF) const
 	auto opcode_upper2=(uint8_t)(opcode >> 6);
 	auto opcode_lower6=(uint8_t)(opcode & (0x3f));
 	auto pos=uint32_t(1);
-	auto max=program_bytes.size();
+	//auto max=program_bytes.size();
 
 	switch(opcode_upper2)
 	{
@@ -841,9 +841,6 @@ bool eh_program_t<ptrsize>::parse_program(
 	
 	}
 
-	auto program_end_position=pos;
-
-	//cout<<endl;
 	return false;
 }
 
@@ -1407,7 +1404,7 @@ bool lsda_t<ptrsize>::parse_lsda(const uint64_t lsda_addr, const DataScoop_t* gc
 		return true;
 
 	auto cs_table_end=pos+cs_table_length;
-	auto cs_table_start_pos=pos;
+	//auto cs_table_start_pos=pos;
 	cs_table_start_offset=pos;
 	cs_table_start_addr=lsda_addr+pos-start_pos;
 	cs_table_end_addr=cs_table_start_addr+cs_table_length;
@@ -1581,7 +1578,7 @@ bool fde_contents_t<ptrsize>::parse_fde(
 
 
 	auto end_pos=pos+length;
-	auto end_length_position=pos;
+	//auto end_length_position=pos;
 
 	auto cie_id=uint32_t(0);
 	if(this->read_type(cie_id, pos, eh_frame_scoop_data, max))
@@ -1716,7 +1713,7 @@ bool split_eh_frame_impl_t<ptrsize>::iterate_fdes()
 			//cout << "FDE length="<< dec << act_length << " cie=[" << setw(6) << hex << cie_position << "]" << endl;
 			if(f.parse_fde(old_position, cie_position, data, max, eh_addr, gcc_except_table_scoop))
 				return true;
-			const auto old_fde_size=fdes.size();
+			//const auto old_fde_size=fdes.size();
 			fdes.insert(f);
 		}
 		//cout << "----------------------------------------"<<endl;
diff --git a/libMEDSannotation/SConscript b/libMEDSannotation/SConscript
index 2e097e32fc108ea964bffb401cf7c7c5871faa45..4c393970d2f32a2b3515dbe6b5eb407ee3f8aff3 100644
--- a/libMEDSannotation/SConscript
+++ b/libMEDSannotation/SConscript
@@ -26,6 +26,7 @@ cpppath='''
 #CFLAGS="-fPIC  "
 
 myenv=myenv.Clone(CPPPATH=Split(cpppath))
+myenv.Append(CXXFLAGS=" -std=c++11 ")
 lib=myenv.Library(lib, Split(files))
 
 install=myenv.Install("$SECURITY_TRANSFORMS_HOME/lib/", lib)
diff --git a/libMEDSannotation/include/MEDS_ProblemFuncAnnotation.hpp b/libMEDSannotation/include/MEDS_ProblemFuncAnnotation.hpp
index 432b40df17f966bbc6f37407bd03429fab91f247..1bf520be751f63742aab39137b0656b8c042068b 100644
--- a/libMEDSannotation/include/MEDS_ProblemFuncAnnotation.hpp
+++ b/libMEDSannotation/include/MEDS_ProblemFuncAnnotation.hpp
@@ -62,7 +62,7 @@ class MEDS_ProblemFuncAnnotation : public MEDS_FuncAnnotation
 	private:
 		void init();
 		void parse();
-		bool matches(std::string line, string pattern, ProblemType prob_type);
+		void matches(std::string line, string pattern, ProblemType prob_type);
 
 	private:
 		std::string m_rawInputLine;
diff --git a/libMEDSannotation/src/MEDS_FPTRShadowAnnotation.cpp b/libMEDSannotation/src/MEDS_FPTRShadowAnnotation.cpp
index ac6000bdce6d855d4243622b183055ee4916152d..e0f8ad4b58ce48d092c239c2cdc22c2d11959525 100644
--- a/libMEDSannotation/src/MEDS_FPTRShadowAnnotation.cpp
+++ b/libMEDSannotation/src/MEDS_FPTRShadowAnnotation.cpp
@@ -221,10 +221,8 @@ bool MEDS_FPTRShadowAnnotation::isRIPRelative() const
 //     [rip-constant]
 uintptr_t MEDS_FPTRShadowAnnotation::computeRIPAddress()
 {
-	RegisterName reg;
-	int offset;
-	uintptr_t instructionAddress;
-	uintptr_t address;
+	RegisterName reg=RegisterName();
+	int offset=0;
 
 	parseRegister(getExpression().c_str(), &reg, &offset);
 
@@ -240,7 +238,7 @@ uintptr_t MEDS_FPTRShadowAnnotation::computeRIPAddress()
 int MEDS_FPTRShadowAnnotation::parseRegisterOffset(const char *p_buf)
 {
 	// e.g.: [rsp] [esp+12] [esp-12] 
-	for (int i = 0; i < strlen(p_buf); ++i)
+	for (auto i = 0U; i < strlen(p_buf); ++i)
 	{
 		if (p_buf[i] == '-' || p_buf[i] == '+')
 		{
@@ -256,7 +254,7 @@ void MEDS_FPTRShadowAnnotation::parseRegister(const char *p_buf, RegisterName *p
 	int startReg = -1;
 	int endReg = -1;
 	int signPos = -1;
-	for (int i = 0; i < strlen(p_buf); ++i)
+	for (auto i = 0U; i < strlen(p_buf); ++i)
 	{
 		if (p_buf[i] == '[') startReg = i+1;
 		if (p_buf[i] == ']') 
diff --git a/libMEDSannotation/src/MEDS_InstructionCheckAnnotation.cpp b/libMEDSannotation/src/MEDS_InstructionCheckAnnotation.cpp
index 2a195b8ac7d5c91158c3eb2bf21d64486fde27e7..cbb505f27d2a49c2772679e98d656da21d6dc888 100644
--- a/libMEDSannotation/src/MEDS_InstructionCheckAnnotation.cpp
+++ b/libMEDSannotation/src/MEDS_InstructionCheckAnnotation.cpp
@@ -138,7 +138,7 @@ void MEDS_InstructionCheckAnnotation::parse()
 	if (m_rawInputLine.find(MEDS_ANNOT_FLOWS_INTO_CRITICAL_SINK)!=string::npos)
 		m_flowsIntoCriticalSink = true;
 
-	int idiom_pos = m_rawInputLine.find(MEDS_ANNOT_IDIOM);
+	auto idiom_pos = m_rawInputLine.find(MEDS_ANNOT_IDIOM);
 	if (idiom_pos != string::npos)
 	{
 		idiom_pos += strlen(MEDS_ANNOT_IDIOM);
diff --git a/libMEDSannotation/src/MEDS_ProblemFuncAnnotation.cpp b/libMEDSannotation/src/MEDS_ProblemFuncAnnotation.cpp
index 6ef8d681e834fdcbd9d09d60b28a7964726c6e9f..b42d0d1af848a2d0488fbf30feadd7d040c788ce 100644
--- a/libMEDSannotation/src/MEDS_ProblemFuncAnnotation.cpp
+++ b/libMEDSannotation/src/MEDS_ProblemFuncAnnotation.cpp
@@ -91,7 +91,7 @@ void MEDS_ProblemFuncAnnotation::parse()
 	
 }
 
-bool MEDS_ProblemFuncAnnotation::matches(string line, string pattern, ProblemType prob_type)
+void MEDS_ProblemFuncAnnotation::matches(string line, string pattern, ProblemType prob_type)
 {
 	
         if (line.find(pattern)!=string::npos)
diff --git a/libStructDiv/SConscript b/libStructDiv/SConscript
index 2a0d786661a3ba6f1201a5e72b6e1fb2649da336..8b38ac43f269caea3edfc01cb1863e5ffdbc1a49 100644
--- a/libStructDiv/SConscript
+++ b/libStructDiv/SConscript
@@ -4,7 +4,7 @@ Import('env')
 
 
 lib1=SConscript("src/SConscript")
-lib2=SConscript("test/SConscript")
+#lib2=SConscript("test/SConscript")
 
-rets = [ lib1, lib2]
+rets = [ lib1 ]
 Return('rets')
diff --git a/libStructDiv/include/structured_diversity.h b/libStructDiv/include/structured_diversity.h
index 121a14a7fc2571c7e50a2586040055f94d23be16..3178f51588a3ab29cd80b2bdfa12f4bbb141019e 100644
--- a/libStructDiv/include/structured_diversity.h
+++ b/libStructDiv/include/structured_diversity.h
@@ -27,6 +27,7 @@ class StructuredDiversity_t
 		{
 			// nothing else to do.
 		}
+		virtual ~StructuredDiversity_t() { } 
 
 
 		// Perform a barrier of type T.  T should be marshable
diff --git a/libtransform/src/transform.cpp b/libtransform/src/transform.cpp
index 09b03f260ddb4725efbf5df855e8cff97da1e330..46b23092031b1cf8d3ca60838e9a3d461b40239f 100644
--- a/libtransform/src/transform.cpp
+++ b/libtransform/src/transform.cpp
@@ -20,31 +20,6 @@
 
 #include "transform.hpp"
 #include "Rewrite_Utility.hpp"
-// #include <bea_deprecated.hpp>
-
-/*
- * Find the first occurrence of find in s, ignore case.
- */
-static char *
-my_strcasestr(const char* s, char *find)
-{
-	char c, sc;
-	size_t len;
-
-	if ((c = *find++) != 0) {
-		c = tolower((unsigned char)c);
-		len = strlen(find);
-		do {
-			do {
-				if ((sc = *s++) == 0)
-					return (NULL);
-			} while ((char)tolower((unsigned char)sc) != c);
-		} while (strncasecmp(s, find, len) != 0);
-		s--;
-	}
-	return ((char *)s);
-}
-
 #define OPTIMIZE_ASSEMBLY
 
 using namespace libTransform;
@@ -1489,7 +1464,7 @@ Instruction_t* Transform::registerCallbackHandler64(string p_callbackHandler, in
 	postCallback->GetAddress()->SetVirtualOffset(postCallbackReturn);
 
 	// push the address to return to once the callback handler is invoked
-	sprintf(tmpbuf,"mov rax, 0x%x", postCallbackReturn);
+	sprintf(tmpbuf,"mov rax, 0x%x", (uint32_t)postCallbackReturn);
 	instr = addNewAssembly(instr, tmpbuf);
 
 	instr = addNewAssembly(instr, "push rax");
@@ -1545,7 +1520,7 @@ void Transform::logMessage(const std::string &p_method, const MEDS_InstructionCh
 
 void libTransform::convertToLowercase(string &str)
 {
-	for (int i = 0; i < str.length(); ++i)
+	for (auto i = 0U; i < str.length(); ++i)
 	{
 		str[i] = tolower(str[i]);
 	}
diff --git a/pebliss/trunk/pe_lib/pe_checksum.cpp b/pebliss/trunk/pe_lib/pe_checksum.cpp
index be74e8fae8e734750fd90f74db9b54b97461f24e..ab7cc5ced64bd5e531e5d68baeec4ea4d69bad48 100644
--- a/pebliss/trunk/pe_lib/pe_checksum.cpp
+++ b/pebliss/trunk/pe_lib/pe_checksum.cpp
@@ -38,7 +38,7 @@ uint32_t calculate_checksum(std::istream& file)
 
 		//Calculate checksum for each byte of file
 		std::streamoff filesize = pe_utils::get_file_size(file);
-		for(long long i = 0; i < filesize; i += 4)
+		for(unsigned long long i = 0; i < (unsigned long long) filesize; i += 4)
 		{
 			unsigned long dw = 0;
 
diff --git a/tools/SConscript b/tools/SConscript
index 9233a064be699ccc92b7bd90f715b3fa27f43ce4..03f4a0199b1a4a4eaac731e22f18ba4bc5405012 100644
--- a/tools/SConscript
+++ b/tools/SConscript
@@ -9,17 +9,17 @@ dirs='''
 	cover
 	fix_rets
         meds2pdb	
-	ret_shadow_stack
 	safefr
 	selective_cfi
-	simple_cdi
 	spasm
-	cookbook
 	dump_map
 	hook_start
 	'''
 
 nobuild_dirs='''
+	cookbook
+	simple_cdi
+	ret_shadow_stack
 	print_cfi_stats
 	memcover
 	'''
diff --git a/tools/dump_map/dump_map.cpp b/tools/dump_map/dump_map.cpp
index ba47423da749d615489a8311a0ceece4ee2282b1..2473b13dfdf07831cfe6b9eda7cfa36bb97c9009 100644
--- a/tools/dump_map/dump_map.cpp
+++ b/tools/dump_map/dump_map.cpp
@@ -58,10 +58,10 @@ int main(int argc, char **argv)
                 exit(1);
         }
 
-	auto dump_icfs_flag=(unsigned long long)-1; 
+	auto dump_icfs_flag=(db_id_t)BaseObj_t::NOT_IN_DATABASE; 
 	auto dump_icfs_str=getenv("DUMP_ICFS");
 	if(dump_icfs_str)
-		dump_icfs_flag=strtoull(dump_icfs_str,NULL,0);
+		dump_icfs_flag=(db_id_t)strtoull(dump_icfs_str,NULL,0);
 		
 
         string programName(argv[0]);
diff --git a/tools/hook_start/hook_start.cpp b/tools/hook_start/hook_start.cpp
index d63118b5561522b778cc7ce25294d233ba3c1a51..ee4ebfc4f885b70544dcb608649c2302b3c8b50d 100644
--- a/tools/hook_start/hook_start.cpp
+++ b/tools/hook_start/hook_start.cpp
@@ -49,9 +49,8 @@ Instruction_t *HookStart::add_instrumentation(Instruction_t *site)
 	virtual_offset_t postCallbackReturn = getAvailableAddress();
 	char pushRetBuf[100],
 	     movIdBuf[100],
-			 movRaxBuf[100],
-			 movRspBuf[100],
-			 movRetBuf[100];
+	     movRaxBuf[100],
+	     movRspBuf[100];
 	sprintf(pushRetBuf,"push qword 0x%lx", postCallbackReturn);
 	sprintf(movIdBuf,"mov rdi, 0x0");
 	sprintf(movRaxBuf,"mov rsi, rax");
@@ -63,10 +62,7 @@ Instruction_t *HookStart::add_instrumentation(Instruction_t *site)
 
 	Instruction_t *tmp=site,
 	              *callback=NULL,
-								*post_callback=NULL,
-								*fallthrough=NULL;
-
-	fallthrough = site->GetFallthrough();
+	              *post_callback=NULL;
 
 	site=insertAssemblyBefore(firp,tmp,"push rsp");
 	tmp=insertAssemblyAfter(firp,tmp,"push rbp");
@@ -144,8 +140,6 @@ int HookStart::execute()
 		  ++it)
 		{
 			Instruction_t *insn = *it;
-			virtual_offset_t target = 0;
-
 			if (insn->GetAddress() && 
 			    insn->GetAddress()->GetVirtualOffset()==m_elfiop->get_entry())
 			{
diff --git a/tools/meds2pdb/meds2pdb.cpp b/tools/meds2pdb/meds2pdb.cpp
index 71c57ba46196ced53763eaaaf56df49ad67de37f..75e615c1217be1bce8de2631426082cf986e3d7a 100644
--- a/tools/meds2pdb/meds2pdb.cpp
+++ b/tools/meds2pdb/meds2pdb.cpp
@@ -19,6 +19,7 @@
  */
 
 #include <iostream>
+#include <iomanip>
 #include <map>
 #include <time.h>
 #include <string.h>
@@ -94,10 +95,8 @@ void insert_instructions(int fileID, const vector<wahoo::Instruction*> &instruct
 	// for each instruction:
 	//    populate instruction table
 
-	int count = 0;
-
 	pqxx::tablewriter W_addrs(txn,addressTable);
-	for (int i = 0; i < instructions.size(); i ++ )
+	for (auto i = 0U; i < instructions.size(); i ++ )
 	{
     		char buf[128];
 
@@ -128,7 +127,7 @@ void insert_instructions(int fileID, const vector<wahoo::Instruction*> &instruct
 	W_addrs.complete();
 
 	pqxx::tablewriter W_insns(txn,instructionTable);
-  	for (int i = 0; i < instructions.size(); i ++)
+  	for (auto i = 0U; i < instructions.size(); i ++)
 	{
 		const auto instruction = instructions[i];
 		const auto addr = instruction->getAddress();
@@ -189,19 +188,18 @@ void insert_functions(int fileID, const vector<wahoo::Function*> &functions  )
   txn.exec("SET client_encoding='LATIN1';");
 
   // bulk insert of function information into the DB
-  int count = 0;
-  for (int i = 0; i < functions.size(); i += STRIDE)
+  for (auto i = 0U; i < functions.size(); i += STRIDE)
   {  
     string query = "INSERT INTO " + functionTable;
     query += " (function_id, name, stack_frame_size, out_args_region_size, use_frame_pointer, is_safe) VALUES ";
 
 
-    for (int j = i; j < i + STRIDE; ++j)
+    for (auto j = i; j < i + STRIDE; ++j)
     {
       if (j >= functions.size()) break;
       wahoo::Function *f = functions[j];
       string functionName = f->getName();
-      app_iaddr_t functionAddress = f->getAddress();
+      //app_iaddr_t functionAddress = f->getAddress();
       int functionFrameSize =  f->getFrameSize(); 
 
       int function_id = j;
@@ -235,21 +233,20 @@ void update_functions(int fileID, const vector<wahoo::Function*> &functions  )
   txn.exec("SET client_encoding='LATIN1';");
 
   // bulk insert of function information into the DB
-  int count = 0;
   string query;
-  for (int i = 0; i < functions.size(); i += STRIDE )
+  for (auto i = 0U; i < functions.size(); i += STRIDE )
   {  
     query="";
-    for (int j = i; j < i + STRIDE; ++j)
+    for (auto j = i; j < i + STRIDE; ++j)
     {
         if (j >= functions.size()) break;
       	wahoo::Function *f = functions[j];
       	string functionName = f->getName();
       	app_iaddr_t functionAddress = f->getAddress();
-      	int functionSize = f->getSize();
+      	//int functionSize = f->getSize();
       	int function_id = f->getFunctionID();
-      	int outArgsRegionSize = f->getOutArgsRegionSize();
-      	bool useFP = f->getUseFramePointer();
+      	//int outArgsRegionSize = f->getOutArgsRegionSize();
+      	//bool useFP = f->getUseFramePointer();
 	int insnid=-1; 	// NOT_IN_DATABASE
 
 
@@ -335,10 +332,10 @@ void update_function_prototype(const vector<wahoo::Function*> &functions, char*
 	work txn(conn);
 	txn.exec("SET client_encoding='LATIN1';");
 
-	for (int i = 0; i < functions.size(); i += STRIDE)
+	for (auto i = 0U; i < functions.size(); i += STRIDE)
 	{  
 		string q = "";
-		for (int j = i; j < i + STRIDE; ++j)
+		for (auto j = i; j < i + STRIDE; ++j)
 		{
 			if (j >= functions.size()) break;
 			wahoo::Function *f = functions[j];
@@ -346,8 +343,8 @@ void update_function_prototype(const vector<wahoo::Function*> &functions, char*
 			app_iaddr_t functionAddress = f->getAddress();
 			VirtualOffset vo(functionAddress);
 
-			MEDS_FuncPrototypeAnnotation* fn_prototype_annot = NULL; 
-			MEDS_FuncPrototypeAnnotation* fn_returntotype_annot = NULL; 
+			//MEDS_FuncPrototypeAnnotation* fn_prototype_annot = NULL; 
+			//MEDS_FuncPrototypeAnnotation* fn_returntotype_annot = NULL; 
 			
 			std::vector<MEDS_Arg> *args = NULL;
 			MEDS_Arg *returnArg = NULL;
@@ -357,7 +354,7 @@ void update_function_prototype(const vector<wahoo::Function*> &functions, char*
 				std::pair<MEDS_Annotations_t::iterator,MEDS_Annotations_t::iterator> ret; 
 				ret = annotations.equal_range(vo);
 				MEDS_FuncPrototypeAnnotation* p_annotation; 
-				for ( MEDS_Annotations_t::iterator it = ret.first; it != ret.second; ++it)
+				for ( auto it = ret.first; it != ret.second; ++it)
 				{    
 					MEDS_AnnotationBase *base_type=(it->second);
 					p_annotation = dynamic_cast<MEDS_FuncPrototypeAnnotation*>(base_type);
@@ -383,7 +380,7 @@ void update_function_prototype(const vector<wahoo::Function*> &functions, char*
 				int func_type_id = getNewTypeId();
 				int basic_type_id = T_UNKNOWN;
 
-				for (int i = 0; i < args->size(); ++i)
+				for (auto i = 0U; i < args->size(); ++i)
 				{
 					if ((*args)[i].isNumericType())
 						basic_type_id = T_NUMERIC;
diff --git a/tools/safefr/fill_in_safefr.cpp b/tools/safefr/fill_in_safefr.cpp
index 043862aa85ce591548f4f73d7c4296fe53b681b3..9ba1b5674d49e7e5b23b063ad78cab46744a1c9b 100644
--- a/tools/safefr/fill_in_safefr.cpp
+++ b/tools/safefr/fill_in_safefr.cpp
@@ -104,7 +104,7 @@ static void add_annotations(FileIR_t* firp)
 }
 
 
-main(int argc, char* argv[])
+int main(int argc, char* argv[])
 {
 
 	if(argc!=2)
@@ -159,5 +159,6 @@ main(int argc, char* argv[])
 	cout<<"Done!"<<endl;
 
 	delete pidp;
+	return 0;
 }
 
diff --git a/tools/selective_cfi/color_map.cpp b/tools/selective_cfi/color_map.cpp
index fa61fa3bcd2c6cd3e8be3eaa106c7f32b8a94323..1f490fea45fefbbf26dc1a1383b4fd13c585a57e 100644
--- a/tools/selective_cfi/color_map.cpp
+++ b/tools/selective_cfi/color_map.cpp
@@ -23,7 +23,7 @@ bool ColoredInstructionNonces_t::create()
 	{
 		const ICFS_t& the_icfs=*it;
 
-		for(int slot_no=0; /* loop until break */ ; slot_no++)
+		for(auto slot_no=0U; /* loop until break */ ; slot_no++)
 		{
 			// check if we need to allocate a new slot
 			if(slot_no<slots_used.size())
@@ -95,7 +95,7 @@ bool ColoredInstructionNonces_t::create()
 	// output stats
 	cout<<"# ATTRIBUTE slots_used="<<slots_used.size()<<endl;
 	int total_slots = 0;
-	for(int slot_no=0; slot_no<slots_used.size(); slot_no++)
+	for(auto slot_no=0U; slot_no<slots_used.size(); slot_no++)
 	{
 		cout<<"# ATTRIBUTE used_slot"<<slot_no<<"="<<slots_used[slot_no].SlotsUsed()<<endl;
 		total_slots += slots_used[slot_no].SlotsUsed();
diff --git a/tools/selective_cfi/scfi_instr.cpp b/tools/selective_cfi/scfi_instr.cpp
index 63068638dd857bc76f89f91f9bad785329645075..a23a2126df5c236c26a73541129940ee4ac2657c 100644
--- a/tools/selective_cfi/scfi_instr.cpp
+++ b/tools/selective_cfi/scfi_instr.cpp
@@ -28,8 +28,8 @@
 #include <math.h>
 #include <exeio.h>
 #include <elf.h>
-#include "elfio/elfio.hpp"
-#include "elfio/elfio_dump.hpp"
+//#include "elfio/elfio.hpp"
+//#include "elfio/elfio_dump.hpp"
 
 
 
@@ -37,156 +37,6 @@
 using namespace std;
 using namespace libIRDB;
 
-virtual_offset_t getAvailableAddress(FileIR_t *p_virp)
-{
-
-        static int counter = -16;
-        counter += 16;
-        return 0xf0020000 + counter;
-}
-
-
-
-
-static Instruction_t* registerCallbackHandler64(FileIR_t* firp, Instruction_t *p_orig, string p_callbackHandler, int p_numArgs)
-{
-
-        Instruction_t *instr;
-        Instruction_t *first;
-        char tmpbuf[1024];
-
-        // save flags and 16 registers (136 bytes)
-        // call pushes 8 bytes
-        // Total: 8 * 18 = 144
-        first = instr = addNewAssembly(firp,NULL, "push rsp");
-        instr = addNewAssembly(firp,instr, "push rbp");
-        instr = addNewAssembly(firp,instr, "push rdi");
-        instr = addNewAssembly(firp,instr, "push rsi");
-        instr = addNewAssembly(firp,instr, "push rdx");
-        instr = addNewAssembly(firp,instr, "push rcx");
-        instr = addNewAssembly(firp,instr, "push rbx");
-        instr = addNewAssembly(firp,instr, "push rax");
-        instr = addNewAssembly(firp,instr, "push r8");
-        instr = addNewAssembly(firp,instr, "push r9");
-        instr = addNewAssembly(firp,instr, "push r10");
-        instr = addNewAssembly(firp,instr, "push r11");
-        instr = addNewAssembly(firp,instr, "push r12");
-        instr = addNewAssembly(firp,instr, "push r13");
-        instr = addNewAssembly(firp,instr, "push r14");
-        instr = addNewAssembly(firp,instr, "push r15");
-        instr = addNewAssembly(firp,instr, "pushf");
-
-        // handle the arguments (if any): rdi, rsi, rdx, rcx, r8, r9
-        // first arg starts at byte +144
-        instr = addNewAssembly(firp,instr, "mov rdi, rsp");
-
-	if (p_numArgs >= 1)
-                instr = addNewAssembly(firp,instr,  "mov rsi, [rsp+144]");
-        if (p_numArgs >= 2)
-                instr = addNewAssembly(firp,instr,  "mov rdx, [rsp+152]");
-        if (p_numArgs >= 3)
-                instr = addNewAssembly(firp,instr,  "mov rcx, [rsp+160]");
-        if (p_numArgs >= 4)
-                instr = addNewAssembly(firp,instr,  "mov r8, [rsp+168]");
-        if (p_numArgs > 4)
-                assert(0); // only handle up to 5 args
-
-        // pin the instruction that follows the callback handler
-        Instruction_t* postCallback = allocateNewInstruction(firp, BaseObj_t::NOT_IN_DATABASE, NULL);
-        virtual_offset_t postCallbackReturn = getAvailableAddress(firp);
-        postCallback->GetAddress()->SetVirtualOffset(postCallbackReturn);
-
-        // push the address to return to once the callback handler is invoked
-        sprintf(tmpbuf,"mov rax, 0x%x", (unsigned int)postCallbackReturn);
-        instr = addNewAssembly(firp,instr, tmpbuf);
-
-        instr = addNewAssembly(firp,instr, "push rax");
-
-        // use a nop instruction for the actual callback
-        instr = addNewAssembly(firp,instr, "nop");
-        instr->SetComment(" -- callback: " + p_callbackHandler);
-        instr->SetCallback(p_callbackHandler);
-        instr->SetFallthrough(postCallback);
-
-
-        // need to make sure the post callback address is pinned
-        // (so that ILR and other transforms do not relocate it)
-        AddressID_t *indTarg = new AddressID_t();
-        firp->GetAddresses().insert(indTarg);
-        indTarg->SetVirtualOffset(postCallback->GetAddress()->GetVirtualOffset());
-        indTarg->SetFileID(BaseObj_t::NOT_IN_DATABASE); // SPRI global namespace
-        postCallback->SetIndirectBranchTargetAddress(indTarg);
-
-        // restore registers
-        firp->RegisterAssembly(postCallback, "popf");
-
-
-        instr = addNewAssembly(firp,postCallback, "pop r15");
-        instr = addNewAssembly(firp,instr, "pop r14");
-        instr = addNewAssembly(firp,instr, "pop r13");
-        instr = addNewAssembly(firp,instr, "pop r12");
-        instr = addNewAssembly(firp,instr, "pop r11");
-        instr = addNewAssembly(firp,instr, "pop r10");
-        instr = addNewAssembly(firp,instr, "pop r9");
-        instr = addNewAssembly(firp,instr, "pop r8");
-        instr = addNewAssembly(firp,instr, "pop rax");
-        instr = addNewAssembly(firp,instr, "pop rbx");
-        instr = addNewAssembly(firp,instr, "pop rcx");
-        instr = addNewAssembly(firp,instr, "pop rdx");
-        instr = addNewAssembly(firp,instr, "pop rsi");
-        instr = addNewAssembly(firp,instr, "pop rdi");
-        instr = addNewAssembly(firp,instr, "pop rbp");
-        instr = addNewAssembly(firp,instr, "lea rsp, [rsp+8]");
-
-        instr = addNewAssembly(firp,instr, "ret");
-
-        // return first instruction in the callback handler chain
-        return first;
-
-}
-
-
-// x86-64
-// 20140421
-static void ConvertCallToCallbackHandler64(FileIR_t* firp, Instruction_t *p_orig, string p_callbackHandler, int p_numArgs)
-{
-	static std::map<std::string, Instruction_t*> m_handlerMap;
-        // nb: if first time, register and cache callback handler sequence
-        if (m_handlerMap.count(p_callbackHandler) == 0)
-        {
-                m_handlerMap[p_callbackHandler] = registerCallbackHandler64(firp,p_orig, p_callbackHandler, p_numArgs);
-        }
-
-        if (p_orig)
-                p_orig->SetTarget(m_handlerMap[p_callbackHandler]);
-}
-
-
-static Instruction_t* addCallbackHandlerSequence
-	(
-	  FileIR_t* firp,
-  	  Instruction_t *p_orig, 
-	  bool before,
-	  std::string p_detector
-	)
-{
-
-	if(before)
-		insertAssemblyBefore(firp,p_orig,"lea rsp, [rsp-128]");
-	else
-		assert(0); // add handling  for inserting lea after given insn
-
-        p_orig->SetComment("callback: " + p_detector);
-
-
-        Instruction_t* call =insertAssemblyAfter(firp,p_orig,"call 0");
-
-        ConvertCallToCallbackHandler64(firp, call, p_detector, 0); // no args for now
-
-	insertAssemblyAfter(firp,call,"lea rsp, [rsp + 128 + 0]"); // no args for nwo 
-
-        return p_orig;
-}
 
 Relocation_t* SCFI_Instrument::FindRelocation(Instruction_t* insn, string type)
 {
@@ -311,7 +161,7 @@ bool SCFI_Instrument::mark_targets()
 			{
 				ColoredSlotValues_t v=color_map->GetColorsOfIBT(insn);
 				int size=1;
-				for(int i=0;i<v.size();i++)
+				for(auto i=0U;i<v.size();i++)
 				{
 					if(!v[i].IsValid())
 						continue;
@@ -650,7 +500,7 @@ void SCFI_Instrument::AddReturnCFI(Instruction_t* insn, ColoredSlotValue_t *v)
 	}
 		
 	int size=1;
-	int position=0;
+	//int position=0;
 	string slow_cfi_path_reloc_string;
 	if(do_coloring && !do_common_slow_path)
 	{
@@ -1003,9 +853,10 @@ bool SCFI_Instrument::instrument_jumps()
 	if (cfi_branch_ret_checks > 0) 
 		cfi_branch_ret_complete_ratio = (double)cfi_branch_ret_complete / cfi_branch_ret_checks;
 
-	double cfi_branch_complete_ratio = NAN;
-	if (ibt_complete > 0)
-		cfi_branch_complete_ratio = (double) cfi_checks / ibt_complete;
+	//double cfi_branch_complete_ratio = NAN;
+	//if (ibt_complete > 0)
+	//	cfi_branch_complete_ratio = (double) cfi_checks / ibt_complete;
+
 	
 
 	cout << "# ATTRIBUTE cfi_jmp_complete_ratio=" << cfi_branch_jmp_complete_ratio << endl;
@@ -1067,7 +918,7 @@ static void insert_into_scoop_at(const string &str, DataScoop_t* scoop, FileIR_t
 	// update each reloc to point to the new location.
 	for_each(scoop->GetRelocations().begin(), scoop->GetRelocations().end(), [str,at](Relocation_t* reloc)
 	{
-		if(reloc->GetOffset()>=at)
+		if((unsigned int)reloc->GetOffset()>=at)
 			reloc->SetOffset(reloc->GetOffset()+str.size());
 		
 	});
@@ -1251,15 +1102,15 @@ bool SCFI_Instrument::add_got_entries()
 
 	// find all the necessary scoops;
 	const auto dynamic_scoop=find_scoop(firp,".dynamic");
-	const auto gotplt_scoop=find_scoop(firp,".got.plt");
-	const auto got_scoop=find_scoop(firp,".got");
+	//const auto gotplt_scoop=find_scoop(firp,".got.plt");
+	//const auto got_scoop=find_scoop(firp,".got");
 	const auto dynstr_scoop=find_scoop(firp,".dynstr");
 	const auto dynsym_scoop=find_scoop(firp,".dynsym");
-	const auto relaplt_scoop=find_scoop(firp,".rela.dyn coalesced w/.rela.plt");
-	const auto relplt_scoop=find_scoop(firp,".rel.dyn coalesced w/.rel.plt");
-	const auto relscoop=relaplt_scoop!=NULL ?  relaplt_scoop : relplt_scoop;
-	const auto search_in = gotplt_scoop==NULL ? got_scoop : gotplt_scoop;
-	const auto to_dl_runtime_resolve=find_runtime_resolve<T_Elf_Sym,T_Elf_Rela, T_Elf_Dyn, rela_shift, reloc_type, ptrsize>(search_in);
+	//const auto relaplt_scoop=find_scoop(firp,".rela.dyn coalesced w/.rela.plt");
+	//const auto relplt_scoop=find_scoop(firp,".rel.dyn coalesced w/.rel.plt");
+	//const auto relscoop=relaplt_scoop!=NULL ?  relaplt_scoop : relplt_scoop;
+	//const auto search_in = gotplt_scoop==NULL ? got_scoop : gotplt_scoop;
+	//const auto to_dl_runtime_resolve=find_runtime_resolve<T_Elf_Sym,T_Elf_Rela, T_Elf_Dyn, rela_shift, reloc_type, ptrsize>(search_in);
 
 
 	// add necessary GOT entries.
@@ -1427,9 +1278,9 @@ bool SCFI_Instrument::execute()
 	if(do_multimodule)
 	{
 		if(firp->GetArchitectureBitWidth()==64)
-			success = success && add_dl_support<ELFIO::Elf64_Sym, ELFIO::Elf64_Rela, ELFIO::Elf64_Dyn, R_X86_64_GLOB_DAT, 32, 8>();
+			success = success && add_dl_support<Elf64_Sym, Elf64_Rela, Elf64_Dyn, R_X86_64_GLOB_DAT, 32, 8>();
 		else
-			success = success && add_dl_support<ELFIO::Elf32_Sym, ELFIO::Elf32_Rel, ELFIO::Elf32_Dyn, R_386_GLOB_DAT, 8, 4>();
+			success = success && add_dl_support<Elf32_Sym, Elf32_Rel, Elf32_Dyn, R_386_GLOB_DAT, 8, 4>();
 	}
 
 
diff --git a/tools/selective_cfi/scfi_instr.hpp b/tools/selective_cfi/scfi_instr.hpp
index 9d18de3e480d988ef3336d9db111158351a30af9..cbf78e8fd7e2c2c342578ff46a0f15935259466b 100644
--- a/tools/selective_cfi/scfi_instr.hpp
+++ b/tools/selective_cfi/scfi_instr.hpp
@@ -43,19 +43,19 @@ class SCFI_Instrument
 				bool p_do_multimodule=false,
 				bool p_do_exe_nonce_for_call=false
 			) 
-			: firp(the_firp), 
+			: 
+		  	  firp(the_firp), 
 			  do_coloring(p_do_coloring), 
 			  do_common_slow_path(p_do_common_slow_path), 
 			  do_jumps(p_do_jumps), 
 			  do_calls(p_do_calls), 
 			  do_rets(p_do_rets), 
-			  protect_safefn(p_do_safefn), 
 			  do_multimodule(p_do_multimodule), 
+			  protect_safefn(p_do_safefn), 
 			  do_exe_nonce_for_call(p_do_exe_nonce_for_call), 
-			  ExecutableNonceValue("\x90", 1),
 			  ret_shared(NULL),
-			  zestcfi_function_entry(NULL)
-
+			  zestcfi_function_entry(NULL),
+			  ExecutableNonceValue("\x90", 1)
 		{ 
 			std::cout<<std::boolalpha;
 			std::cout<<"#ATTRIBUTE do_coloring="<<p_do_coloring<<std::endl;
@@ -75,7 +75,7 @@ class SCFI_Instrument
 		}
 		bool execute();
 
-	private:
+	private: // methods
 
 		// helpers for adding GOT entries and symbols for multi-module cfi	
 		template<typename T_Elf_Sym, typename T_Elf_Rela, typename T_Elf_Dyn, int reloc_type, int rela_shift, int B>
@@ -133,9 +133,9 @@ class SCFI_Instrument
 		unsigned int GetNonceOffset(libIRDB::Instruction_t*);
 
 
+	private: // data
 		// predecessors of instructions.
 		libIRDB::InstructionPredecessors_t preds;
-	
 		libIRDB::FileIR_t* firp;
 		bool do_coloring;
 		bool do_common_slow_path;
@@ -145,12 +145,9 @@ class SCFI_Instrument
 		bool do_multimodule;
 		bool protect_safefn;
 		bool do_exe_nonce_for_call;
-
 		std::unique_ptr<ColoredInstructionNonces_t> color_map;
-
 		libIRDB::Instruction_t *ret_shared;
 		libIRDB::Instruction_t *zestcfi_function_entry;
-
 		std::string ExecutableNonceValue;
 };
 
diff --git a/tools/selective_cfi/zest_cfi_runtime/dispatch.c b/tools/selective_cfi/zest_cfi_runtime/dispatch.c
index 4355256fc3c28bb842c80d8958e9550c9301c83e..e6dd745b844fa0fe344ec75cc3aff3ee85dae2cb 100644
--- a/tools/selective_cfi/zest_cfi_runtime/dispatch.c
+++ b/tools/selective_cfi/zest_cfi_runtime/dispatch.c
@@ -6,16 +6,13 @@
 #include <string.h>
 #include <unistd.h>
 
-#define strcmp Zest_Strcmp
-#define strlen Zest_Strlen
-
 // typedef for a function pointer because the syntax is otherwise insane, unreadable and unwriteable.
 typedef void (*zestcfi_func_ptr_t)(ElfW(Addr)) ;
 
 #define DEBUG 0
 
 
-static int strcmp(const char *s1, const char *s2)
+static int Zest_strcmp(const char *s1, const char *s2)
 {
 	for ( ; *s1 == *s2; s1++, s2++)
 		if (*s1 == '\0')
@@ -23,17 +20,19 @@ static int strcmp(const char *s1, const char *s2)
 	return ((*(unsigned char *)s1 < *(unsigned char *)s2) ? -1 : +1);
 }
 
-static size_t strlen( const char *str )
+#if DEBUG
+static size_t Zest_strlen( const char *str )
 {
 	register const char *s;
 	for (s = str; *s; ++s);
 	return(s - str);
 }
+#endif
 
 static void write_str(const char* out)
 {
 #if DEBUG
-	write(2,out,strlen(out));
+	write(2,out,Zest_strlen(out));
 #endif
 }
 
@@ -111,7 +110,7 @@ static ElfW(Addr) find_symtab_entry(const char* tofind, const ElfW(Sym) *symtab,
 		write_str(symstring);
 		write_str("\n");
 #endif
-		if(strcmp(symstring, tofind)==0)
+		if(Zest_strcmp(symstring, tofind)==0)
 			return (ElfW(Addr))&symtab[i];
 	}
 
@@ -124,7 +123,7 @@ int dl_iterate_phdr_callback (struct dl_phdr_info *info, size_t size, void *data
 	ElfW(Addr) *zestcfi_addr=(ElfW(Addr)*)data;
 	ElfW(Addr) target=*zestcfi_addr;
 
-	const char* objname=info->dlpi_name;
+	//const char* objname=info->dlpi_name;
 	const ElfW(Phdr) *phdr_start=info->dlpi_phdr;
 	const ElfW(Half) phnum=info->dlpi_phnum;
 
@@ -142,7 +141,7 @@ int dl_iterate_phdr_callback (struct dl_phdr_info *info, size_t size, void *data
 	const ElfW(Sym) *symtab=(ElfW(Sym)*)find_dynamic_entry(info,DT_SYMTAB, dynamic_start);
 	// apparently some modules don't have a reloc for their symtab pointer properly entry.
 	if(!ptload_for_target_exists(info, phdr_start, phnum, (ElfW(Addr))symtab))
-		symtab=(ElfW(Addr))symtab+(ElfW(Addr))info->dlpi_addr;
+		symtab=(ElfW(Sym)*)((ElfW(Addr))symtab+(ElfW(Addr))info->dlpi_addr);
 
 	if(!symtab) 
 	{
@@ -153,7 +152,7 @@ int dl_iterate_phdr_callback (struct dl_phdr_info *info, size_t size, void *data
 	const char* strtab=(const char*)find_dynamic_entry(info,DT_STRTAB, dynamic_start);
 	// apparently some modules don't have a reloc for their symtab pointer properly entry.
 	if(!ptload_for_target_exists(info, phdr_start, phnum, (ElfW(Addr))strtab))
-		strtab=(ElfW(Addr))strtab+(ElfW(Addr))info->dlpi_addr;
+		strtab=(const char*)((ElfW(Addr))strtab+(ElfW(Addr))info->dlpi_addr);
 	if(!strtab) 
 	{
 		write_str("Couldn't find strtab start. ");
@@ -184,7 +183,9 @@ int dl_iterate_phdr_callback (struct dl_phdr_info *info, size_t size, void *data
 
 zestcfi_func_ptr_t* zest_cfi_dispatch_c(ElfW(Addr) target)
 {
-	write_ptr(target);
+	extern int zestcfi__dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info, size_t size, void *data), void *data);
+
+	write_ptr((void*)target);
 	write_str(" -- ");
 
 	ElfW(Addr) zestcfi_addr=target;
@@ -198,7 +199,7 @@ zestcfi_func_ptr_t* zest_cfi_dispatch_c(ElfW(Addr) target)
 	else
 	{
 		write_str("Found zest-cfi_dispatcher.  Control transfer will be checked.\n");
-		zestcfi_func_ptr_t zest_cfi_ptr = (zestcfi_func_ptr_t) zestcfi_addr;
-		return zestcfi_addr;
+		zestcfi_func_ptr_t *zest_cfi_ptr = (zestcfi_func_ptr_t*) zestcfi_addr;
+		return zest_cfi_ptr;
 	}
 }
diff --git a/tools/selective_cfi/zest_cfi_runtime/dl_iterate.c b/tools/selective_cfi/zest_cfi_runtime/dl_iterate.c
index 492421ca0b02dd25d0094d6fa743e7632ccdfec3..66603234341cef63725d3da5b22dd1bbf605014c 100644
--- a/tools/selective_cfi/zest_cfi_runtime/dl_iterate.c
+++ b/tools/selective_cfi/zest_cfi_runtime/dl_iterate.c
@@ -106,7 +106,7 @@ zestcfi__dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
 
   /* We have to determine the namespace of the caller since this determines
      which namespace is reported.  */
-  size_t nloaded = GL(dl_ns)[0]._ns_nloaded;
+  //size_t nloaded = GL(dl_ns)[0]._ns_nloaded;
   Lmid_t ns = 0;
 #ifdef SHARED
   const void *caller = RETURN_ADDRESS (0);
diff --git a/tools/simple_cdi/scdi_driver.cpp b/tools/simple_cdi/scdi_driver.cpp
index 33d9dbc84564323df635b7ac30b72d8b65fa4e56..4a0ce5dd70bdd85d3940eadc153cc701ab9e8a12 100644
--- a/tools/simple_cdi/scdi_driver.cpp
+++ b/tools/simple_cdi/scdi_driver.cpp
@@ -48,7 +48,7 @@ int main(int argc, char **argv)
 
         string programName(argv[0]);
         int variantID = atoi(argv[1]);
-	int threshold = 1;
+	uint32_t threshold = 1;
 
 	// FIXME: implement getting threshold value from arguments
 
diff --git a/tools/simple_cdi/scdi_instr.cpp b/tools/simple_cdi/scdi_instr.cpp
index 91aad5f4028f71faf7090cd621905fb8d365726e..a365200c477ffe02e494908ee2d4e3b06965702a 100644
--- a/tools/simple_cdi/scdi_instr.cpp
+++ b/tools/simple_cdi/scdi_instr.cpp
@@ -30,13 +30,6 @@
 using namespace std;
 using namespace libIRDB;
 
-virtual_offset_t getAvailableAddress(FileIR_t *p_virp)
-{
-
-        static int counter = -16;
-        counter += 16;
-        return 0xf0020000 + counter;
-}
 
 template< typename T >
 std::string int_to_hex_string( T i )
@@ -47,173 +40,6 @@ std::string int_to_hex_string( T i )
   return stream.str();
 }
 
-
-
-#if 0
-// moved to Rewrite_Utility.cpp
-static Instruction_t* addNewAssembly(FileIR_t* firp, Instruction_t *p_instr, string p_asm)
-{
-        Instruction_t* newinstr;
-        if (p_instr)
-                newinstr = allocateNewInstruction(firp,p_instr->GetAddress()->GetFileID(), p_instr->GetFunction());
-        else   
-                newinstr = allocateNewInstruction(firp,BaseObj_t::NOT_IN_DATABASE, NULL);
-
-        firp->RegisterAssembly(newinstr, p_asm);
-
-        if (p_instr)
-        {
-                newinstr->SetFallthrough(p_instr->GetFallthrough());
-                p_instr->SetFallthrough(newinstr);
-        }
-
-        return newinstr;
-}
-#endif
-
-static Instruction_t* registerCallbackHandler64(FileIR_t* firp, Instruction_t *p_orig, string p_callbackHandler, int p_numArgs)
-{
-
-        Instruction_t *instr;
-        Instruction_t *first;
-        char tmpbuf[1024];
-
-        // save flags and 16 registers (136 bytes)
-        // call pushes 8 bytes
-        // Total: 8 * 18 = 144
-        first = instr = addNewAssembly(firp,NULL, "push rsp");
-        instr = addNewAssembly(firp,instr, "push rbp");
-        instr = addNewAssembly(firp,instr, "push rdi");
-        instr = addNewAssembly(firp,instr, "push rsi");
-        instr = addNewAssembly(firp,instr, "push rdx");
-        instr = addNewAssembly(firp,instr, "push rcx");
-        instr = addNewAssembly(firp,instr, "push rbx");
-        instr = addNewAssembly(firp,instr, "push rax");
-        instr = addNewAssembly(firp,instr, "push r8");
-        instr = addNewAssembly(firp,instr, "push r9");
-        instr = addNewAssembly(firp,instr, "push r10");
-        instr = addNewAssembly(firp,instr, "push r11");
-        instr = addNewAssembly(firp,instr, "push r12");
-        instr = addNewAssembly(firp,instr, "push r13");
-        instr = addNewAssembly(firp,instr, "push r14");
-        instr = addNewAssembly(firp,instr, "push r15");
-        instr = addNewAssembly(firp,instr, "pushf");
-
-        // handle the arguments (if any): rdi, rsi, rdx, rcx, r8, r9
-        // first arg starts at byte +144
-        instr = addNewAssembly(firp,instr, "mov rdi, rsp");
-
-	if (p_numArgs >= 1)
-                instr = addNewAssembly(firp,instr,  "mov rsi, [rsp+144]");
-        if (p_numArgs >= 2)
-                instr = addNewAssembly(firp,instr,  "mov rdx, [rsp+152]");
-        if (p_numArgs >= 3)
-                instr = addNewAssembly(firp,instr,  "mov rcx, [rsp+160]");
-        if (p_numArgs >= 4)
-                instr = addNewAssembly(firp,instr,  "mov r8, [rsp+168]");
-        if (p_numArgs > 4)
-                assert(0); // only handle up to 5 args
-
-        // pin the instruction that follows the callback handler
-        Instruction_t* postCallback = allocateNewInstruction(firp, BaseObj_t::NOT_IN_DATABASE, NULL);
-        virtual_offset_t postCallbackReturn = getAvailableAddress(firp);
-        postCallback->GetAddress()->SetVirtualOffset(postCallbackReturn);
-
-        // push the address to return to once the callback handler is invoked
-        sprintf(tmpbuf,"mov rax, 0x%x", postCallbackReturn);
-        instr = addNewAssembly(firp,instr, tmpbuf);
-
-        instr = addNewAssembly(firp,instr, "push rax");
-
-        // use a nop instruction for the actual callback
-        instr = addNewAssembly(firp,instr, "nop");
-        instr->SetComment(" -- callback: " + p_callbackHandler);
-        instr->SetCallback(p_callbackHandler);
-        instr->SetFallthrough(postCallback);
-
-
-        // need to make sure the post callback address is pinned
-        // (so that ILR and other transforms do not relocate it)
-        AddressID_t *indTarg = new AddressID_t();
-        firp->GetAddresses().insert(indTarg);
-        indTarg->SetVirtualOffset(postCallback->GetAddress()->GetVirtualOffset());
-        indTarg->SetFileID(BaseObj_t::NOT_IN_DATABASE); // SPRI global namespace
-        postCallback->SetIndirectBranchTargetAddress(indTarg);
-
-        // restore registers
-        firp->RegisterAssembly(postCallback, "popf");
-
-
-        instr = addNewAssembly(firp,postCallback, "pop r15");
-        instr = addNewAssembly(firp,instr, "pop r14");
-        instr = addNewAssembly(firp,instr, "pop r13");
-        instr = addNewAssembly(firp,instr, "pop r12");
-        instr = addNewAssembly(firp,instr, "pop r11");
-        instr = addNewAssembly(firp,instr, "pop r10");
-        instr = addNewAssembly(firp,instr, "pop r9");
-        instr = addNewAssembly(firp,instr, "pop r8");
-        instr = addNewAssembly(firp,instr, "pop rax");
-        instr = addNewAssembly(firp,instr, "pop rbx");
-        instr = addNewAssembly(firp,instr, "pop rcx");
-        instr = addNewAssembly(firp,instr, "pop rdx");
-        instr = addNewAssembly(firp,instr, "pop rsi");
-        instr = addNewAssembly(firp,instr, "pop rdi");
-        instr = addNewAssembly(firp,instr, "pop rbp");
-        instr = addNewAssembly(firp,instr, "lea rsp, [rsp+8]");
-
-        instr = addNewAssembly(firp,instr, "ret");
-
-        // return first instruction in the callback handler chain
-        return first;
-
-}
-
-
-// x86-64
-// 20140421
-static void ConvertCallToCallbackHandler64(FileIR_t* firp, Instruction_t *p_orig, string p_callbackHandler, int p_numArgs)
-{
-	static std::map<std::string, Instruction_t*> m_handlerMap;
-        // nb: if first time, register and cache callback handler sequence
-        if (m_handlerMap.count(p_callbackHandler) == 0)
-        {
-                m_handlerMap[p_callbackHandler] = registerCallbackHandler64(firp,p_orig, p_callbackHandler, p_numArgs);
-        }
-
-        if (p_orig)
-                p_orig->SetTarget(m_handlerMap[p_callbackHandler]);
-}
-
-
-static Instruction_t* addCallbackHandlerSequence
-	(
-	  FileIR_t* firp,
-  	  Instruction_t *p_orig, 
-	  bool before,
-	  std::string p_detector
-	)
-{
-
-	if(before)
-		insertAssemblyBefore(firp,p_orig,"lea rsp, [rsp-128]");
-	else
-		assert(0); // add handling  for inserting lea after given insn
-
-        p_orig->SetComment("callback: " + p_detector);
-
-
-        Instruction_t* call =insertAssemblyAfter(firp,p_orig,"call 0");
-
-        ConvertCallToCallbackHandler64(firp, call, p_detector, 0); // no args for now
-
-	insertAssemblyAfter(firp,call,"lea rsp, [rsp + 128 + 0]"); // no args for nwo 
-
-        return p_orig;
-}
-
-
-
-
 bool SimpleCDI_Instrument::add_scdi_instrumentation(Instruction_t* insn)
 {
 	bool success=true;
@@ -328,7 +154,7 @@ bool SimpleCDI_Instrument::is_return(Instruction_t* insn)
 }
 
 // only complete returns need to be instrumented
-bool SimpleCDI_Instrument::needs_scdi_instrumentation(Instruction_t* insn, int target_size_threshold)
+bool SimpleCDI_Instrument::needs_scdi_instrumentation(Instruction_t* insn, uint32_t target_size_threshold)
 {
 	const bool isReturn = is_return(insn);
 
diff --git a/tools/simple_cdi/scdi_instr.hpp b/tools/simple_cdi/scdi_instr.hpp
index 70c43cbef7bf3ec449c865d7faceb918ac71aa8b..d22146399b227392a4e25b1b7e4f2f0d1a75c08b 100644
--- a/tools/simple_cdi/scdi_instr.hpp
+++ b/tools/simple_cdi/scdi_instr.hpp
@@ -28,27 +28,31 @@
 class SimpleCDI_Instrument
 {
 	public:
-		SimpleCDI_Instrument(libIRDB::FileIR_t *the_firp, int p_target_set_threshold=1) : firp(the_firp), 
+		SimpleCDI_Instrument(libIRDB::FileIR_t *the_firp, uint32_t p_target_set_threshold=1) 
+			: 
+			firp(the_firp), 
+			target_set_threshold(p_target_set_threshold),
 			single_target_set_jumps(0),
 			single_target_set_returns(0),
 			num_complete_ibts(0),
 			num_returns(0),
-			num_complete_returns(0),
-			target_set_threshold(p_target_set_threshold) {}
+			num_complete_returns(0)
+		{
+		}
+
 		bool execute();
 
-	private:
+	private: // methods
 
 		bool is_return(libIRDB::Instruction_t* insn);
 		bool add_scdi_instrumentation(libIRDB::Instruction_t* insn);
-		bool needs_scdi_instrumentation(libIRDB::Instruction_t* insn, int p_target_set_threshold);
+		bool needs_scdi_instrumentation(libIRDB::Instruction_t* insn, uint32_t p_target_set_threshold);
 		bool convert_ibs();
 		void display_stats(std::ostream &out);
 	
+	private: // data
 		libIRDB::FileIR_t* firp;
-
-		int target_set_threshold;
-
+		uint32_t target_set_threshold;
 		int single_target_set_jumps;
 		int single_target_set_returns;
 		int num_complete_ibts;
diff --git a/tools/transforms/EhUpdater.cpp b/tools/transforms/EhUpdater.cpp
index ae4b2dea4867607e391fdddf46b092b979b435f0..be57ca73b7c676a7e962daf61e0f051fc65ce880 100644
--- a/tools/transforms/EhUpdater.cpp
+++ b/tools/transforms/EhUpdater.cpp
@@ -31,33 +31,6 @@ static bool read_uleb128
 
 }
 
-// see https://en.wikipedia.org/wiki/LEB128
-static bool read_sleb128 (
-	int64_t &result,
-	uint32_t & position,
-	const uint8_t* const data,
-	const uint32_t max)
-{
-	result = 0;
-	auto shift = 0;
-	auto size = 64;  // number of bits in signed integer;
-	auto byte=uint8_t(0);
-	do
-	{
-		byte = data [position];
-		position++;
-		result |= ((byte & 0x7f)<< shift);
-		shift += 7;
-	} while( (byte & 0x80) != 0);
-
-	/* sign bit of byte is second high order bit (0x40) */
-	if ((shift < size) && ( (byte & 0x40) !=0 /* sign bit of byte is set */))
-		/* sign extend */
-		result |= - (1 << shift);
-	return ( position >= max );
-
-}
-
 static string to_uleb128 (uint64_t value)
 {
 	auto output_str=string("");
@@ -75,37 +48,6 @@ static string to_uleb128 (uint64_t value)
 	return output_str;
 }
 
-static string to_sleb128 (int64_t value)
-{
-	auto output_str=string("");
-	auto more = true;
-	auto negative = (value < 0);
-	auto size = sizeof(value)*8; // no. of bits in signed integer;
-	while(more) 
-	{
-		auto byte = value & 0x7f; // low order 7 bits of value;
-		value >>= 7;
-		/* the following is unnecessary if the implementation of >>= uses an 
-		arithmetic rather than logical shift for a signed left operand */
-		if (negative)
-			value |= - (1 <<(size - 7)); /* sign extend */
-
-		/* sign bit of byte is second high order bit (0x40) */
-		const bool sign_bit_clear = (byte&0x40) == 0; 
-		const bool sign_bit_set = !sign_bit_clear;
-		// if ((value == 0 && sign bit of byte is clear) 
-		// 	|| (value == -1 && sign bit of byte is set))
-		if ((value == 0 && sign_bit_clear ) || (value == -1 && sign_bit_set))
-			more = false;
-		else
-			byte |= 0x80; // set high order bit of byte;
-
-		output_str.push_back(byte);	 // emit byte 
-	}
-	return output_str;
-}
-
-
 /* transform any eh handling info for the FDE program*/
 bool EhUpdater_t::update_program(EhProgram_t* ehpgm)
 {
@@ -138,7 +80,7 @@ bool EhUpdater_t::update_program(EhProgram_t* ehpgm)
 
 			const auto  encoded_factored_new_offset=to_uleb128(factored_new_offset);
 			auto new_dwarf_insn=string("");
-			for(auto i=0;i<offset_pos;i++)
+			for(auto i=0U;i<offset_pos;i++)
 				new_dwarf_insn.push_back(dwarf_insn[i]);
 			new_dwarf_insn+=encoded_factored_new_offset;
 			dwarf_insn=new_dwarf_insn;
diff --git a/tools/transforms/PNRange.hpp b/tools/transforms/PNRange.hpp
index 4b38f90750f998a92d85060861bfefe84b27218e..1665d051ac2ade9e583a94ea0424ec0244638a50 100644
--- a/tools/transforms/PNRange.hpp
+++ b/tools/transforms/PNRange.hpp
@@ -34,6 +34,7 @@ public:
 	PNRange(const PNRange &range);
 	PNRange(const Range &range);
 	PNRange();
+	virtual ~PNRange() {}
 	virtual unsigned int GetPaddingSize() const;
 	virtual int GetDisplacement() const;
 	virtual void SetDisplacement(int offset);
diff --git a/tools/transforms/PNRegularExpressions.cpp b/tools/transforms/PNRegularExpressions.cpp
index 033bc4e0ea0a62ec6afab246a87e4113408f101f..f3be50c52f92996a46596e52d800490823438c25 100644
--- a/tools/transforms/PNRegularExpressions.cpp
+++ b/tools/transforms/PNRegularExpressions.cpp
@@ -94,19 +94,19 @@ PNRegularExpressions::PNRegularExpressions()
 	}
 
 	// match "[esp+reg*scale+disp]"	
-	if(regcomp(&regex_esp_scaled, FIRN(".*\\[%sp"WS"[+].*[+](.+)\\].*"),REG_EXTENDED | REG_ICASE) !=0)
+	if(regcomp(&regex_esp_scaled, FIRN(".*\\[%sp" WS "[+].*[+](.+)\\].*"),REG_EXTENDED | REG_ICASE) !=0)
 	{
 		fprintf(stderr,"Error: regular expression for esp scaled addresses failed\n");
 		exit(1);
 	}
-	if((errcode=regcomp(&regex_lea_rsp, FIRN(".*lea.*\\[.*%sp.*("HEXNUM").*\\].*"),REG_EXTENDED | REG_ICASE)) !=0)
+	if((errcode=regcomp(&regex_lea_rsp, FIRN(".*lea.*\\[.*%sp.*(" HEXNUM ").*\\].*"),REG_EXTENDED | REG_ICASE)) !=0)
 	{
 		char buf[1000];
 		regerror(errcode,&regex_lea_rsp,buf,sizeof(buf));
 		fprintf(stderr,"Error: regular expression for regex_lea_rsp failed, code: %s\n", buf);
 		exit(1);
 	}
-	if((errcode=regcomp(&regex_esp_scaled_nodisp, FIRN(".*\\[%sp"WS"[+]"WS""REGSTRING SCALE"(\\]).*"),REG_EXTENDED | REG_ICASE)) !=0)
+	if((errcode=regcomp(&regex_esp_scaled_nodisp, FIRN(".*\\[%sp" WS "[+]" WS "" REGSTRING SCALE "(\\]).*"),REG_EXTENDED | REG_ICASE)) !=0)
 	{
 		char buf[1000];
 		regerror(errcode,&regex_esp_scaled_nodisp,buf,sizeof(buf));
@@ -114,13 +114,13 @@ PNRegularExpressions::PNRegularExpressions()
 		exit(1);
 	}
 
-	if(regcomp(&regex_ebp_scaled,FIRN(".*\\[%bp"WS"[+]"WS".*[-](.+)\\].*"),REG_EXTENDED | REG_ICASE) !=0)
+	if(regcomp(&regex_ebp_scaled,FIRN(".*\\[%bp" WS "[+]" WS ".*[-](.+)\\].*"),REG_EXTENDED | REG_ICASE) !=0)
 	{
 		fprintf(stderr,"Error: regular expression for ebp scaled addresses failed\n");
 		exit(1);
 	}
 
-	if((errcode=regcomp(&regex_esp_direct,          FIRN(".*\\[%sp"WS"[+]"WS"("HEXNUM")\\].*"),REG_EXTENDED | REG_ICASE)) !=0)
+	if((errcode=regcomp(&regex_esp_direct,          FIRN(".*\\[%sp" WS "[+]" WS "(" HEXNUM ")\\].*"),REG_EXTENDED | REG_ICASE)) !=0)
 	{
 		char buf[1000];
 		regerror(errcode,&regex_esp_direct,buf,sizeof(buf));
@@ -128,7 +128,7 @@ PNRegularExpressions::PNRegularExpressions()
 		exit(1);	
 	}
 
-	if((errcode=regcomp(&regex_esp_direct_negoffset,FIRN(".*\\[%sp"WS"[-]"WS"("HEXNUM")\\].*"),REG_EXTENDED | REG_ICASE)) !=0)
+	if((errcode=regcomp(&regex_esp_direct_negoffset,FIRN(".*\\[%sp" WS "[-]" WS "(" HEXNUM ")\\].*"),REG_EXTENDED | REG_ICASE)) !=0)
 	{
 		char buf[1000];
 		regerror(errcode,&regex_esp_direct_negoffset,buf,sizeof(buf));
@@ -137,7 +137,7 @@ PNRegularExpressions::PNRegularExpressions()
 	}
 
 
-	if(regcomp(&regex_ebp_direct,FIRN(".*\\[%bp"WS"[-]"WS"("HEXNUM")\\].*"),REG_EXTENDED | REG_ICASE) !=0)
+	if(regcomp(&regex_ebp_direct,FIRN(".*\\[%bp" WS "[-]" WS "(" HEXNUM ")\\].*"),REG_EXTENDED | REG_ICASE) !=0)
 	{
 		fprintf(stderr,"Error: regular expression for esp direct addresses failed\n");
 		exit(1);	
@@ -187,7 +187,7 @@ PNRegularExpressions::PNRegularExpressions()
 	//Unlike other expressions, there are two pattern matches here
 	//the first is the scaling factor (if one exists), the second is the
 	//offset.
-	if (regcomp(&regex_scaled_ebp_index, FIRN(".*\\[.*[+]"WS"%bp[*]?(.*)[-](.+)\\].*"), REG_EXTENDED | REG_ICASE) != 0)
+	if (regcomp(&regex_scaled_ebp_index, FIRN(".*\\[.*[+]" WS "%bp[*]?(.*)[-](.+)\\].*"), REG_EXTENDED | REG_ICASE) != 0)
 	{
 		fprintf(stderr,"Error: regular expression for scaled ebp index failed to compile\n");
 		exit(1);
@@ -200,7 +200,7 @@ PNRegularExpressions::PNRegularExpressions()
 	}
 
 
-        if((errcode=regcomp(&regex_add_rbp,FIRN("add ("REGSTRING"), *%bp *"),REG_EXTENDED | REG_ICASE)) !=0)
+        if((errcode=regcomp(&regex_add_rbp,FIRN("add (" REGSTRING "), *%bp *"),REG_EXTENDED | REG_ICASE)) !=0)
         {
                 char buf[1000];
                 regerror(errcode,&regex_add_rbp,buf,sizeof(buf));
diff --git a/tools/transforms/PNStackLayout.cpp b/tools/transforms/PNStackLayout.cpp
index 00b7763def3109f8420e7afd48364db43f7bc3ec..33b76205c8c50ef4e468d100080ef6dbaf1dfc8c 100644
--- a/tools/transforms/PNStackLayout.cpp
+++ b/tools/transforms/PNStackLayout.cpp
@@ -85,7 +85,7 @@ unsigned int PNStackLayout::GetRandomPadding(unsigned int obj_size)
 
 
 
-	if(pn_options->getShouldDoubleFrameSize() && obj_size < pn_options->getDoubleThreshold())
+	if(pn_options->getShouldDoubleFrameSize() && obj_size < (uintptr_t)pn_options->getDoubleThreshold())
 	{
 		//if the original frame size is not aligned, then add as many bytes as necessary to align it
 		//for example, if 3 bytes over alignment, and the alignment stride is 8, then add 8 - 3, or 5 bytes. 
diff --git a/tools/transforms/PNTransformDriver.cpp b/tools/transforms/PNTransformDriver.cpp
index 8ad761da1904dddd067f5d5ae8ffb7e7842f31fd..6bca7926edb6855423546679637abd061ca1dfa0 100644
--- a/tools/transforms/PNTransformDriver.cpp
+++ b/tools/transforms/PNTransformDriver.cpp
@@ -47,7 +47,7 @@
 
 #define MAX_JUMPS_TO_FOLLOW 100000
 
-#define WHOLE_CONTAINER(s) begin(s), end(s)
+#define ALLOF(s) begin(s), end(s)
 
 using namespace std;
 using namespace libIRDB;
@@ -603,7 +603,7 @@ static bool is_exit_insn(Instruction_t* prev)
 		const auto ib_targets=prev->GetIBTargets();
 		if(ib_targets)
 		{
-			const auto out_of_function_it=find_if(WHOLE_CONTAINER(*ib_targets), [&](const Instruction_t* i)
+			const auto out_of_function_it=find_if(ALLOF(*ib_targets), [&](const Instruction_t* i)
 				{ 
 					return i->GetFunction() != prev->GetFunction(); 
 				} ) ;
@@ -662,9 +662,7 @@ static bool	check_for_cond_frame(Function_t *func, ControlFlowGraph_t* cfg)
 	if(!b)
 		return true;
 
-#define WHOLE_CONTAINER(s) (s).begin(), (s).end()
-
-	const auto has_rsp_sub_it= find_if(WHOLE_CONTAINER(func->GetInstructions()), is_rsp_sub_insn);
+	const auto has_rsp_sub_it= find_if(ALLOF(func->GetInstructions()), is_rsp_sub_insn);
 
 	if(has_rsp_sub_it == func->GetInstructions().end())
 		return true;
@@ -971,7 +969,7 @@ bool PNTransformDriver::check_jump_tables(Instruction_t* insn)
 	set<int> jump_tab_entries;
 	for(int i=0;jump_tab_entries.size()<5;i++)
 	{
-		if(offset+i*4+sizeof(int) > (int) pSec->get_size())
+		if((int)(offset+i*4+sizeof(int)) > (int) pSec->get_size())
 			break;
 
 		const int *table_entry_ptr=(const int*)&(secdata[offset+i*4]);
@@ -1162,7 +1160,7 @@ DN:   0x4824e0: .long 0x4824e0-LN
         for(int i=0;table_entries.size()<5;i++)
         {
                 // check that we can still grab a word from this section
-                if(offset+sizeof(int) > (int)pSec->get_size())
+                if((int)(offset+sizeof(int)) > (int)pSec->get_size())
                         break;
 
                 const int *table_entry_ptr=(const int*)&(secdata[offset]);
@@ -2652,7 +2650,7 @@ inline bool PNTransformDriver::Instruction_Rewrite(PNStackLayout *layout, Instru
 				Instruction_t *new_instr = insertAssemblyBefore(virp,instr,ss_add.str(),NULL);
 				new_instr->SetComment("Dynamic array padding:" +ss_add.str());
 
-				Instruction_t *new_instr2 = insertAssemblyAfter(virp,instr,ss_sub.str(),NULL);
+				insertAssemblyAfter(virp,instr,ss_sub.str(),NULL);
 				return true;			
 			}
 		}
diff --git a/tools/transforms/StackLayout.hpp b/tools/transforms/StackLayout.hpp
index 8d3302bd5fbbaa96e595a63acfc3d43d056fd5e7..5e7c2411f51dd021f5d84ec1b8ad42f34dd7ab25 100644
--- a/tools/transforms/StackLayout.hpp
+++ b/tools/transforms/StackLayout.hpp
@@ -51,6 +51,7 @@ public:
 	StackLayout(const std::string &layout_name, const std::string &function_name, unsigned int frame_alloc_size,
 				unsigned int saved_regs_size, bool frame_pointer, unsigned int out_args_size);
 	StackLayout(const StackLayout &layout);
+	virtual ~StackLayout() {}
 	virtual void InsertESPOffset(int offset);
 	virtual void InsertEBPOffset(int offset);
 	virtual int EBPToESP(int offset);
diff --git a/xform/elfreader.cpp b/xform/elfreader.cpp
index 8e69068956dbe0cec64da4d3f74c9b1256b896a9..799533edb7c353485bacfbb33518a31bcbdee2a6 100644
--- a/xform/elfreader.cpp
+++ b/xform/elfreader.cpp
@@ -91,30 +91,16 @@ string ElfReader::read(app_iaddr_t p_pc, unsigned p_numBytes)
   for ( int i = 0; i < m_reader->sections.size(); ++i ) 
   {    
     section* pSec = m_reader->sections[i];
-
-/*
-    cerr << "Sec. name: " << pSec->get_name() 
-         << " Sec. address: " << pSec->get_address() 
-         << " Sec. offset: " << pSec->GetOffset() 
-         << " Sec. size: " << pSec->get_size() << std::endl;
-*/
-
     if (pSec->get_address() + pSec->get_size() < 1) continue;
     if (p_pc >= pSec->get_address() && p_pc <= (pSec->get_address() + pSec->get_size() - 1))
     {
       // found the section, now read off the data
       long offset = p_pc - pSec->get_address();
-//      cerr << "ElfReader::read(): pc 0x" << hex << p_pc << " is in section#" << i << ": " << pSec->get_name() << " at offset: " << offset << endl;
-      for (int j = 0; j < p_numBytes; ++j)
-      {
-        unsigned char c = pSec->get_data()[j + offset];
-      }
 
-      cerr << endl;
+      // caution!  This may result in an overflow of the section and fault if called with p_numBytes too big.
       return string(pSec->get_data() + offset, p_numBytes);
     }
   }
-
   return string();
 }
 
diff --git a/xform/function_descriptor.cpp b/xform/function_descriptor.cpp
index 58fabd42a3e269adf5b5552f9643d05d1fa1acff..c2dec6d5c6cdc050548262db9e26936be661f18e 100644
--- a/xform/function_descriptor.cpp
+++ b/xform/function_descriptor.cpp
@@ -123,7 +123,7 @@ double wahoo::Function::getInstructionCoverage(int *p_count, int *p_total)
   unsigned count = 0;
   if (m_allInstructions.size() == 0)
     return 0.0;
-  for (int i = 0; i < m_allInstructions.size(); ++i)
+  for (auto i = 0U; i < m_allInstructions.size(); ++i)
   {
     if (m_allInstructions[i]->isVisited())
       count++;
diff --git a/xform/null_transform.cpp b/xform/null_transform.cpp
index b96786675a994eaec1337dc795a9c80b92d60aee..cd392576411a4ff153af219e9f00d525dee19341 100644
--- a/xform/null_transform.cpp
+++ b/xform/null_transform.cpp
@@ -20,10 +20,9 @@
 
 #include <iostream>
 
-#include "targ-config.h"
+//#include "targ-config.h"
 
 #include "elfio/elfio.hpp"
-#include "elfio/elfio_dump.hpp"
 
 #include "null_transform.h"
 #include "stackref_hash.h"
@@ -60,7 +59,7 @@ void NullTransform::rewrite()
       continue;
     }
 
-    for (int j = 0; j < f->getInstructions().size(); ++j)
+    for (auto j = 0U; j < f->getInstructions().size(); ++j)
     {
       wahoo::Instruction *instr = f->getInstructions()[j];
       char buf[1024];
diff --git a/xform/rewriter.cpp b/xform/rewriter.cpp
index 672647dc53c9a3626c17a234a02a552b5f239fbb..5c79a40192685cbf343b52121870780f4a47b4ce 100644
--- a/xform/rewriter.cpp
+++ b/xform/rewriter.cpp
@@ -26,9 +26,8 @@
 
 
 #include "all.h"
-#include "targ-config.h"
+//#include "targ-config.h"
 #include "elfio/elfio.hpp"
-#include "elfio/elfio_dump.hpp"
 
 
 #include "rewriter.h"
@@ -55,7 +54,7 @@ wahoo::Function* Rewriter::ensureFunctionExists(const app_iaddr_t p_addr)
 	if (m_functions.count(p_addr) > 0)
 		return m_functions[p_addr];
 
-    wahoo::Function *fn = new wahoo::Function(p_addr);
+	wahoo::Function *fn = new wahoo::Function(p_addr);
 	m_functions[p_addr] = fn;
 
 	return fn;
@@ -77,16 +76,16 @@ wahoo::Instruction* Rewriter::ensureInstructionExists(const app_iaddr_t p_addr)
 */
 void Rewriter::readAnnotationFile(char p_filename[])
 {
-	FILE* fin;
-	app_iaddr_t addr = 0, prevPC = 0, prevStackDeallocPC = 0;
+	FILE* fin=NULL;
+	app_iaddr_t addr = 0, prevStackDeallocPC = 0;
 	union { int size, type;} size_type_u;
 	char type[200];
 	char scope[200];
 	char remainder[200000];
-	char * objname;
-	int pid=0;
-	int var_length=0;
-	int bitvector_size_bits=0;
+	
+	
+	
+	
 	int line=0;
 
 	wahoo::Function *nullfn = new wahoo::Function("ThisIsNotAFunction", 0, 0);
@@ -119,12 +118,10 @@ void Rewriter::readAnnotationFile(char p_filename[])
 		fscanf(fin, "%s%s", type,scope);
 
 		int annot_type;
-		int is_spec_annot=FALSE;
 		if(size_type_u.type<-255)
 		{
 			annot_type=size_type_u.type+256;
 			size_type_u.type=size_type_u.type+256;
-			is_spec_annot=TRUE;
 		}
 		else
 			annot_type=size_type_u.type;
@@ -258,9 +255,6 @@ void Rewriter::readAnnotationFile(char p_filename[])
 			/* optimizing annotation about not needing heavyweight metadata update */
 			/* ignore for now */
 			
-			// stash away instruction
-			prevPC = addr;
-
             		/*
 	 		 *  sudeep -- added support for flags
 			 */
@@ -274,13 +268,15 @@ void Rewriter::readAnnotationFile(char p_filename[])
 				sshk.pc = addr;
 				ensureInstructionExists(addr);
 				m_instructions[addr]->setSize(size_type_u.size);
-				if (sshv = (stackref_hash_value_t*) Hashtable_get(stackrefs_hash, &sshk))
+				sshv = (stackref_hash_value_t*) Hashtable_get(stackrefs_hash, &sshk);
+				if (sshv)
 				{
                     		        instrmap_hash_key_t key;
                                         key.pc = addr;
                     		        instrmap_hash_value_t* val;
 //					printf("STACK ALLOC INSTRUCTION CONFIRMED AT pc=0x%x size=%d\n", sshk.pc, size_type_u.size);
-				        if (val = (instrmap_hash_value_t*) Hashtable_get(instrmaps_hash, &key))
+				        val = (instrmap_hash_value_t*) Hashtable_get(instrmaps_hash, &key);
+				        if (val)
                                         {
 //					  printf("STACK ALLOC INSTRUCTION CONFIRMED: site alloc marked\n");
                                           val->site_alloc = 1; 
@@ -303,7 +299,8 @@ void Rewriter::readAnnotationFile(char p_filename[])
 					fgets(remainder, sizeof(remainder), fin);
 					// this is a *potential* stack deallocation instruction only
 					if ((strstr(remainder,"leave") && strstr(remainder,"EFLAGS")) ||
- 						strstr(remainder,"pop") && strstr(remainder,"ebp"))
+ 					    (strstr(remainder,"pop"  ) && strstr(remainder,"ebp"   ))
+					   )
 					{
 						prevStackDeallocPC = addr;
 					}
@@ -333,7 +330,7 @@ void Rewriter::readAnnotationFile(char p_filename[])
 
 				// rely on the fact that INST BELONGTO is the first INST annotation in a MEDS file (warning: but it is not required to be there)
 //				assert(m_functions[func_addr]);
-				wahoo::Function *fn = ensureFunctionExists(func_addr);
+				(void)ensureFunctionExists(func_addr);
 				wahoo::Instruction* instr = new wahoo::Instruction(addr, -1, m_functions[func_addr]);
 				m_instructions[addr] = instr;
 
@@ -405,6 +402,7 @@ MEDS doesn't mark this as a stack reference
 					case -2:	/* fast meta data updates, results = always number */
 							/* remaining params: <reason> reg, {reg, ...} ZZ comment */
 					{
+						break;
 					}
 
 					/* skip warning message on this instruction, promised safe */
@@ -504,8 +502,8 @@ MEDS doesn't mark this as a stack reference
 		}
 		else if(strcmp(type,"DATAREF")==0)
 		{
-			char name[1000], parent_child[1000], offset_str[1000];
-			int id, parent_id, offset, parent_offset;
+			char parent_child[1000];
+			int id;
 			if(size_type_u.size<=0)
 			{
 			}
@@ -526,7 +524,7 @@ MEDS doesn't mark this as a stack reference
 			}
 			else if(strcmp(scope,"STACK")==0)
 			{
-				char esp[1000], plus[1000], offset_str[1000], name[1000];
+				char esp[1000], plus[1000], name[1000];
 				int esp_offset;
 
 				/* remaining params id, addr, parent/child, name */
@@ -539,9 +537,8 @@ MEDS doesn't mark this as a stack reference
 					/* add to the stackref hashtable, also record the id->stackref mapping so we can
 					 * can easily lookup the id for any fields we find.
 					 */
-                        		stackref_hash_value_t *sshv=add_stack_ref(addr,size_type_u.size, esp_offset);
+                        		(void)add_stack_ref(addr,size_type_u.size, esp_offset);
 					
-//					printf("New stack frame at: pc=0x%x size=0x%x  HT-count=%d\n", addr, sshv->size, stackrefs_hash->count);
 
 					// @todo: record frame size
 					// set the frame size
@@ -642,13 +639,17 @@ void Rewriter::readElfFile(char p_filename[])
 
 	assert(pin);
 
-	fscanf(pin, "%p", &addr);
+	
+	void* tmp=NULL;
+	fscanf(pin, "%p", &tmp);
+	addr=(app_iaddr_t)tmp;
 	fgets(buf,sizeof(buf),pin);
 	do 
 	{
 		if(m_instructions[addr]==NULL)
 			m_instructions[addr]=new wahoo::Instruction(addr,-1,NULL);
-		fscanf(pin,"%x", &addr);
+		fscanf(pin,"%p", &tmp);
+		addr=(app_iaddr_t)tmp;
 		fgets(buf,sizeof(buf),pin);
 	} while(!feof(pin));
 
@@ -673,22 +674,12 @@ void Rewriter::disassemble()
 
 	vector<wahoo::Instruction*> instructions=getAllInstructions(); 
 
-	fprintf(stderr, "Rewriter::disassemble(): number of instructions: %d\n", instructions.size());
+	fprintf(stderr, "Rewriter::disassemble(): number of instructions: %" PRIuPTR "\n", (uintptr_t)instructions.size());
 
-    	for (int j = 0; j < instructions.size(); ++j)
+    	for (auto j = 0U; j < instructions.size(); ++j)
     	{
       		wahoo::Instruction *instr = instructions[j];
 
-      		// disassemble using BeaEngine
-      		//DISASM disasm;
-      		//memset(&disasm, 0, sizeof(DISASM));
-
-      		//disasm.Options = NasmSyntax + PrefixedNumeral;
-
-
-      		//disasm.EIP = (UIntPtr) getElfReader()->getInstructionBuffer(instr->getAddress());
-      		//disasm.VirtualAddr = instr->getAddress();
-
 		const auto instr_data=(void*)(getElfReader()->getInstructionBuffer(instr->getAddress()));
 		const auto disasm=DecodedInstruction_t(instr->getAddress(), instr_data, 16);
 
@@ -740,7 +731,7 @@ void Rewriter::commitFn2SPRI(wahoo::Function *p_func, FILE *p_fp)
 {
   if (!p_func) return;
 
-  for (int i = 0; i < p_func->getRewrites().size(); ++i)
+  for (auto i = 0U; i < p_func->getRewrites().size(); ++i)
   {
     string rewriteRule = p_func->getRewrites()[i];
     fprintf(p_fp, "%s\n", rewriteRule.c_str());
@@ -752,7 +743,6 @@ vector<wahoo::Function*> Rewriter::getCandidateFunctions()
   vector<wahoo::Function*> candidates;
   for (map<app_iaddr_t, wahoo::Function*>::iterator it = m_functions.begin(); it != m_functions.end(); ++it)
   {
-    app_iaddr_t addr = it->first;
     wahoo::Function* f = it->second;
 
     // null fn or fn marked as SAFE by MEDS -- we don't xform those
@@ -769,7 +759,6 @@ vector<wahoo::Function*> Rewriter::getNonCandidateFunctions()
   vector<wahoo::Function*> nonCandidates;
   for (map<app_iaddr_t, wahoo::Function*>::iterator it = m_functions.begin(); it != m_functions.end(); ++it)
   {
-    app_iaddr_t addr = it->first;
     wahoo::Function* f = it->second;
 
     // null fn or fn marked as SAFE by MEDS -- we don't xform those
@@ -787,7 +776,6 @@ vector<wahoo::Function*> Rewriter::getAllFunctions()
 
   for (map<app_iaddr_t, wahoo::Function*>::iterator it = m_functions.begin(); it != m_functions.end(); ++it)
   {
-    app_iaddr_t addr = it->first;
     wahoo::Function* f = it->second;
 
     if (!f) continue;
@@ -804,7 +792,6 @@ vector<wahoo::Instruction*> Rewriter::getAllInstructions()
 
   for (map<app_iaddr_t, wahoo::Instruction*>::iterator it = m_instructions.begin(); it != m_instructions.end(); ++it)
   {
-    app_iaddr_t addr = it->first;
     wahoo::Instruction* instr = it->second;
 
     if (!instr) continue;
@@ -850,7 +837,7 @@ map<wahoo::Function*, double> Rewriter::getFunctionCoverage(char *p_instructionF
 
   vector<wahoo::Instruction*> allInstructions = getAllInstructions();
 
-  for (int i = 0; i < allInstructions.size(); ++i)
+  for (auto i = 0U; i < allInstructions.size(); ++i)
   {
     wahoo::Instruction* instr = allInstructions[i];
     if (!instr) continue;
@@ -864,7 +851,7 @@ map<wahoo::Function*, double> Rewriter::getFunctionCoverage(char *p_instructionF
   // now all instructions have been marked as visited or not
 
   vector<wahoo::Function*> allFunctions = getAllFunctions();
-  for (int i = 0; i < allFunctions.size(); ++i)
+  for (auto i = 0U; i < allFunctions.size(); ++i)
   {
     coverage[allFunctions[i]] = allFunctions[i]->getInstructionCoverage();
   }
diff --git a/xform/rewriter.h b/xform/rewriter.h
index b7c00f75467f471b7f364c51fc5e0f8d7fdb3d92..1163fc4badf6528003ea0c0871fc236cf06dcb93 100644
--- a/xform/rewriter.h
+++ b/xform/rewriter.h
@@ -1,8 +1,8 @@
 #include <map>
 #include <set>
-#include "targ-config.h"
+//#include "targ-config.h"
 #include "elfio/elfio.hpp"
-#include "elfio/elfio_dump.hpp"
+//#include "elfio/elfio_dump.hpp"
 
 #include "elfreader.h"
 #include "function_descriptor.h"