Skip to content

Commit

Permalink
InitOptions::auto_initialize_logging(true) does not work with assignm…
Browse files Browse the repository at this point in the history
…ent operator.

  ros2/rclcpp#1258

Signed-off-by: Tomoya.Fujita <Tomoya.Fujita@sony.com>
  • Loading branch information
fujitatomoya committed Aug 4, 2020
1 parent 3248760 commit 26f5517
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ custom_executable(rclcpp_1175)
#custom_executable(ros2_946_pub)
#custom_executable(ros2_946_sub)
#custom_executable(ros2_644)
custom_executable(rclcpp_1258)

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND
"${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 6.0)
Expand Down
17 changes: 17 additions & 0 deletions src/rclcpp_1258.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <stdlib.h>
#include <iostream>

#include <rclcpp/rclcpp.hpp>

int main(int argc, char * argv[])
{
rclcpp::init(argc, argv);
auto options = rclcpp::InitOptions().auto_initialize_logging(false);
if (options.auto_initialize_logging()) {
std::cout << "options.auto_initialize_logging() is true\n";
return EXIT_FAILURE;
} else {
std::cout << "options.auto_initialize_logging() is false\n";
return EXIT_SUCCESS;
}
}

0 comments on commit 26f5517

Please sign in to comment.