Skip to content

Commit 21dee3b

Browse files
committed
Fix g++9 warnings.
GitOrigin-RevId: 5f0565bfaefff9bf41f372f2f249489650985fae
1 parent fca3eac commit 21dee3b

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,11 @@ endif()
228228
if (GCC AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))
229229
add_cxx_compiler_flag("-Wno-maybe-uninitialized") # too much false positives
230230
endif()
231+
if (GCC AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0))
232+
# warns about a lot of "return std::move", which are not redundant for compilers without fix for DR 1579, i.e. GCC 4.9 or clang 3.8
233+
# see http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1579
234+
add_cxx_compiler_flag("-Wno-redundant-move")
235+
endif()
231236

232237
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem /usr/include/c++/v1")
233238
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")

‎td/telegram/ContactsManager.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7582,7 +7582,7 @@ void ContactsManager::on_get_channel_participants_success(
75827582
total_count = static_cast<int32>(result.size());
75837583
}
75847584

7585-
const auto max_participant_count = get_channel_type(channel_id) == ChannelType::Megagroup ? 9950 : 195;
7585+
const auto max_participant_count = get_channel_type(channel_id) == ChannelType::Megagroup ? 9750 : 195;
75867586
auto participant_count =
75877587
filter.is_recent() && total_count != 0 && total_count < max_participant_count ? total_count : -1;
75887588
int32 administrator_count = filter.is_administrators() ? total_count : -1;

‎tdactor/td/actor/impl/Scheduler.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ void Scheduler::send_lambda(ActorRef actor_ref, EventT &&lambda) {
237237
[&]() {
238238
auto event = Event::lambda(std::forward<EventT>(lambda));
239239
event.set_link_token(actor_ref.token());
240-
return std::move(event);
240+
return event;
241241
});
242242
}
243243

@@ -251,7 +251,7 @@ void Scheduler::send_closure(ActorRef actor_ref, EventT &&closure) {
251251
[&]() {
252252
auto event = Event::immediate_closure(std::forward<EventT>(closure));
253253
event.set_link_token(actor_ref.token());
254-
return std::move(event);
254+
return event;
255255
});
256256
}
257257

0 commit comments

Comments
 (0)