diff options
author | lloyd <[email protected]> | 2013-11-16 14:52:25 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2013-11-16 14:52:25 +0000 |
commit | e23193c46074dc28e500a944103abb08ec725723 (patch) | |
tree | ce47b479b1ec39cf9619c4dd92d0ad39340dffd7 /src | |
parent | cac58ad976fffdab5d78a4c835c0e3cbd9e33ae8 (diff) |
Enable all the GCC warning flags, as we now require at least GCC 4.7 anyway
Fix a few nullptr and cast warnings.
Diffstat (limited to 'src')
-rw-r--r-- | src/build-data/cc/gcc.txt | 4 | ||||
-rw-r--r-- | src/entropy/dev_random/dev_random.cpp | 2 | ||||
-rw-r--r-- | src/entropy/unix_procs/unix_procs.cpp | 4 | ||||
-rw-r--r-- | src/filters/filter.cpp | 2 | ||||
-rw-r--r-- | src/utils/mul128.h | 2 |
5 files changed, 6 insertions, 8 deletions
diff --git a/src/build-data/cc/gcc.txt b/src/build-data/cc/gcc.txt index cfa223098..3a12c64ed 100644 --- a/src/build-data/cc/gcc.txt +++ b/src/build-data/cc/gcc.txt @@ -9,9 +9,7 @@ add_lib_dir_option -L add_lib_option -l lang_flags "-D_REENTRANT -std=c++11" -warning_flags "-Wextra -Wall" - -maintainer_warning_flags "-Werror -Wall -Wextra -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wold-style-cast -Wno-error=old-style-cast -Wzero-as-null-pointer-constant" +warning_flags "-Werror -Wno-error=old-style-cast -Wall -Wextra -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wold-style-cast -Wzero-as-null-pointer-constant" lib_opt_flags "-O3" check_opt_flags "-O2" diff --git a/src/entropy/dev_random/dev_random.cpp b/src/entropy/dev_random/dev_random.cpp index fedba6810..3f8df8749 100644 --- a/src/entropy/dev_random/dev_random.cpp +++ b/src/entropy/dev_random/dev_random.cpp @@ -79,7 +79,7 @@ void Device_EntropySource::poll(Entropy_Accumulator& accum) timeout.tv_sec = (MS_WAIT_TIME / 1000); timeout.tv_usec = (MS_WAIT_TIME % 1000) * 1000; - if(::select(max_fd + 1, &read_set, 0, 0, &timeout) < 0) + if(::select(max_fd + 1, &read_set, nullptr, nullptr, &timeout) < 0) return; secure_vector<byte>& io_buffer = accum.get_io_buffer(READ_ATTEMPT); diff --git a/src/entropy/unix_procs/unix_procs.cpp b/src/entropy/unix_procs/unix_procs.cpp index ca9f48f10..c36941f43 100644 --- a/src/entropy/unix_procs/unix_procs.cpp +++ b/src/entropy/unix_procs/unix_procs.cpp @@ -1,4 +1,4 @@ -/* + /* * Gather entropy by running various system commands in the hopes that * some of the output cannot be guessed by a remote attacker. * @@ -236,7 +236,7 @@ void Unix_EntropySource::poll(Entropy_Accumulator& accum) timeout.tv_sec = (MS_WAIT_TIME / 1000); timeout.tv_usec = (MS_WAIT_TIME % 1000) * 1000; - if(::select(max_fd + 1, &read_set, 0, 0, &timeout) < 0) + if(::select(max_fd + 1, &read_set, nullptr, nullptr, &timeout) < 0) return; // or continue? for(auto& proc : m_procs) diff --git a/src/filters/filter.cpp b/src/filters/filter.cpp index f4b2d34bc..3eb924172 100644 --- a/src/filters/filter.cpp +++ b/src/filters/filter.cpp @@ -109,7 +109,7 @@ void Filter::set_next(Filter* filters[], size_t size) port_num = 0; filter_owns = 0; - while(size && filters && filters[size-1] == 0) + while(size && filters && (filters[size-1] == nullptr)) --size; if(filters && size) diff --git a/src/utils/mul128.h b/src/utils/mul128.h index 7927e5d08..6725021ba 100644 --- a/src/utils/mul128.h +++ b/src/utils/mul128.h @@ -27,7 +27,7 @@ namespace Botan { #define BOTAN_FAST_64X64_MUL(a,b,lo,hi) \ do { \ - const uint128_t r = (uint128_t)a * b; \ + const uint128_t r = static_cast<uint128_t>(a) * b; \ *hi = (r >> 64) & 0xFFFFFFFFFFFFFFFF; \ *lo = (r ) & 0xFFFFFFFFFFFFFFFF; \ } while(0) |