Skip to content

Commit 754bafe

Browse files
committed
Minor fixes related to release build
1 parent 040cf93 commit 754bafe

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ if(WIN32)
7373
add_definitions(-DBOOST_ALL_DYN_LINK -DBOOST_THREAD_USE_LIB -D_WIN32_WINNT=0x0501)
7474
else()
7575
add_definitions(-Wall -Wextra -pedantic -Werror)
76-
set(LINK_DEPENDENCIES pthread ${Boost_LIBRARIES} catch_lib)
76+
#add_definitions(-fsanitize=undefined -fsanitize=address -fno-omit-frame-pointer)
77+
set(LINK_DEPENDENCIES pthread ${Boost_LIBRARIES} catch_lib) # asan ubsan
7778
endif()
7879

7980
add_subdirectory(examples)

examples/CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
find_package(Threads REQUIRED)
22

3+
set(LINK_DEPENDENCIES ${Boost_LIBRARIES} Threads::Threads)
4+
35
add_executable(stream-parse stream-parse.cpp)
4-
target_link_libraries(stream-parse ${Boost_LIBRARIES} Threads::Threads)
6+
target_link_libraries(stream-parse ${LINK_DEPENDENCIES})
57

68
add_executable(synch-subscription synch-subscription.cpp)
7-
target_link_libraries(synch-subscription ${Boost_LIBRARIES} Threads::Threads)
9+
target_link_libraries(synch-subscription ${LINK_DEPENDENCIES})
810

911
add_executable(speed_test_async_multi speed_test_async_multi.cpp)
10-
target_link_libraries(speed_test_async_multi ${Boost_LIBRARIES} Threads::Threads)
12+
target_link_libraries(speed_test_async_multi ${LINK_DEPENDENCIES})
1113

1214
add_executable(multi-threads-1 multi-threads-1.cpp)
13-
target_link_libraries(multi-threads-1 ${Boost_LIBRARIES} Threads::Threads)
15+
target_link_libraries(multi-threads-1 ${LINK_DEPENDENCIES})

examples/speed_test_async_multi.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ int main(int argc, char **argv) {
100100
rx_buff,
101101
[&](const boost::system::error_code &ec, auto &&r) {
102102
assert(!ec);
103+
(void)ec;
103104
auto &replies =
104105
boost::get<r::markers::array_holder_t<Iterator>>(r.result);
105106
auto &last_reply = replies.elements.at(replies.elements.size() - 1);
@@ -115,6 +116,7 @@ int main(int argc, char **argv) {
115116

116117
c.async_write(tx_buff, cmd_wpapper, [&](const boost::system::error_code &ec,
117118
auto bytes_transferred) {
119+
(void)ec;
118120
assert(!ec);
119121
tx_buff.consume(bytes_transferred);
120122
std::cout << "done writing...\n";

include/bredis/impl/async_op.ipp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@ struct result_handler_t<Iterator, parsing_policy::drop_result> {
2424
using policy_t = parsing_policy::drop_result;
2525
using positive_result_t = parse_result_mapper_t<Iterator, policy_t>;
2626

27-
positive_result_t result;
2827
std::size_t replies_count;
2928
size_t cumulative_consumption;
3029
size_t count;
30+
positive_result_t result;
3131

3232
result_handler_t(std::size_t replies_count_)
33-
: replies_count{replies_count_}, cumulative_consumption{0}, count{0} {}
33+
: replies_count{replies_count_},
34+
cumulative_consumption{0}, count{0}, result{0} {}
3435

3536
void init() {
3637
// NO-OP;
@@ -52,11 +53,11 @@ struct result_handler_t<Iterator, parsing_policy::keep_result> {
5253
using policy_t = parsing_policy::keep_result;
5354
using positive_result_t = parse_result_mapper_t<Iterator, policy_t>;
5455

55-
positive_result_t result;
56-
markers::array_holder_t<Iterator> tmp_results;
5756
std::size_t replies_count;
5857
size_t cumulative_consumption;
5958
size_t count;
59+
positive_result_t result;
60+
markers::array_holder_t<Iterator> tmp_results;
6061

6162
result_handler_t(std::size_t replies_count_)
6263
: replies_count{replies_count_}, cumulative_consumption{0}, count{0} {}

0 commit comments

Comments
 (0)