From 2b5399b12560fd07b0c0cde1de844e26ec48c295 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven!=20Ragnar=C3=B6k?= Date: Wed, 1 May 2019 09:06:16 -0400 Subject: [PATCH] Cast %p formatted argument to void *. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With https://github.com/ros2/rcutils/pull/154 warnings are emitted for "dangerous patterns" in format strings. %p expects a void * argument so a void * argument we shall provide. Signed-off-by: Steven! Ragnarök --- pluginlib/include/pluginlib/class_loader_imp.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pluginlib/include/pluginlib/class_loader_imp.hpp b/pluginlib/include/pluginlib/class_loader_imp.hpp index d101142c..212aed6b 100644 --- a/pluginlib/include/pluginlib/class_loader_imp.hpp +++ b/pluginlib/include/pluginlib/class_loader_imp.hpp @@ -101,7 +101,7 @@ ClassLoader::ClassLoader( /***************************************************************************/ { RCUTILS_LOG_DEBUG_NAMED("pluginlib.ClassLoader", "Creating ClassLoader, base = %s, address = %p", - base_class.c_str(), this); + base_class.c_str(), (void *)this); try { ament_index_cpp::get_package_prefix(package_); } catch (const ament_index_cpp::PackageNotFoundError & exception) { @@ -115,7 +115,7 @@ ClassLoader::ClassLoader( classes_available_ = determineAvailableClasses(plugin_xml_paths_); RCUTILS_LOG_DEBUG_NAMED("pluginlib.ClassLoader", "Finished constructring ClassLoader, base = %s, address = %p", - base_class.c_str(), this); + base_class.c_str(), (void *)this); } template @@ -124,7 +124,7 @@ ClassLoader::~ClassLoader() { RCUTILS_LOG_DEBUG_NAMED("pluginlib.ClassLoader", "Destroying ClassLoader, base = %s, address = %p", - getBaseClassType().c_str(), this); + getBaseClassType().c_str(), (void *)this); } @@ -148,7 +148,7 @@ T * ClassLoader::createClassInstance(const std::string & lookup_name, bool au "Attempting to create instance through low-level MultiLibraryClassLoader..."); T * obj = lowlevel_class_loader_.createUnmanagedInstance(getClassType(lookup_name)); RCUTILS_LOG_DEBUG_NAMED("pluginlib.ClassLoader", - "Instance created with object pointer = %p", obj); + "Instance created with object pointer = %p", (void *)obj); return obj; } catch (const class_loader::CreateClassException & ex) {