aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/alloc/alloc_mmap/mmap_mem.cpp6
-rw-r--r--src/alloc/secmem.h9
-rw-r--r--src/block/camellia/camellia.cpp4
-rw-r--r--src/build-data/cc/gcc.txt2
-rw-r--r--src/math/numbertheory/pow_mod.h2
-rw-r--r--src/utils/dyn_load/dyn_load.h3
6 files changed, 18 insertions, 8 deletions
diff --git a/src/alloc/alloc_mmap/mmap_mem.cpp b/src/alloc/alloc_mmap/mmap_mem.cpp
index e4b602764..17c189e9b 100644
--- a/src/alloc/alloc_mmap/mmap_mem.cpp
+++ b/src/alloc/alloc_mmap/mmap_mem.cpp
@@ -128,15 +128,17 @@ void MemoryMapping_Allocator::dealloc_block(void* ptr, size_t n)
const byte PATTERNS[] = { 0x00, 0xF5, 0x5A, 0xAF, 0x00 };
+ // The char* casts are for Solaris, args are void* on most other systems
+
for(size_t i = 0; i != sizeof(PATTERNS); ++i)
{
std::memset(ptr, PATTERNS[i], n);
- if(::msync((char*)ptr, n, MS_SYNC))
+ if(::msync(static_cast<char*>(ptr), n, MS_SYNC))
throw MemoryMapping_Failed("Sync operation failed");
}
- if(::munmap((char*)ptr, n))
+ if(::munmap(static_cast<char*>(ptr), n))
throw MemoryMapping_Failed("Could not unmap file");
}
diff --git a/src/alloc/secmem.h b/src/alloc/secmem.h
index 2552343d6..884f2ebc0 100644
--- a/src/alloc/secmem.h
+++ b/src/alloc/secmem.h
@@ -172,11 +172,12 @@ class MemoryRegion
* Copy constructor
* @param other the other region to copy
*/
- MemoryRegion(const MemoryRegion<T>& other)
+ MemoryRegion(const MemoryRegion<T>& other) :
+ buf(0),
+ used(0),
+ allocated(0),
+ alloc(other.alloc)
{
- buf = 0;
- used = allocated = 0;
- alloc = other.alloc;
resize(other.size());
copy(&other[0], other.size());
}
diff --git a/src/block/camellia/camellia.cpp b/src/block/camellia/camellia.cpp
index 054558c35..54c54e7d2 100644
--- a/src/block/camellia/camellia.cpp
+++ b/src/block/camellia/camellia.cpp
@@ -12,6 +12,8 @@ namespace Botan {
namespace Camellia_F {
+namespace {
+
u64bit F(u64bit v, u64bit K)
{
static const byte SBOX[256] = {
@@ -103,6 +105,8 @@ u64bit left_rot_lo(u64bit h, u64bit l, size_t shift)
}
+}
+
/*
* Camellia Encryption
*/
diff --git a/src/build-data/cc/gcc.txt b/src/build-data/cc/gcc.txt
index 3de85099c..6173f6271 100644
--- a/src/build-data/cc/gcc.txt
+++ b/src/build-data/cc/gcc.txt
@@ -13,7 +13,7 @@ add_lib_option -l
lang_flags "-D_REENTRANT -Wno-long-long"
warning_flags "-W -Wall"
-maintainer_warning_flags "-Werror -Weffc++ -Wall -Wextra -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wold-style-cast"
+maintainer_warning_flags "-Werror -Wall -Wextra -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wold-style-cast"
lib_opt_flags "-O3"
check_opt_flags "-O2"
diff --git a/src/math/numbertheory/pow_mod.h b/src/math/numbertheory/pow_mod.h
index 7ec237d72..9857c1833 100644
--- a/src/math/numbertheory/pow_mod.h
+++ b/src/math/numbertheory/pow_mod.h
@@ -61,7 +61,7 @@ class BOTAN_DLL Power_Mod
Power_Mod(const BigInt& = 0, Usage_Hints = NO_HINTS);
Power_Mod(const Power_Mod&);
- ~Power_Mod();
+ virtual ~Power_Mod();
private:
mutable Modular_Exponentiator* core;
Usage_Hints hints;
diff --git a/src/utils/dyn_load/dyn_load.h b/src/utils/dyn_load/dyn_load.h
index b37a52e84..4d5cfb296 100644
--- a/src/utils/dyn_load/dyn_load.h
+++ b/src/utils/dyn_load/dyn_load.h
@@ -59,6 +59,9 @@ class Dynamically_Loaded_Library
}
private:
+ Dynamically_Loaded_Library(const Dynamically_Loaded_Library&);
+ Dynamically_Loaded_Library& operator=(const Dynamically_Loaded_Library&);
+
std::string lib_name;
void* lib;
};