From 926a72a5408b2caa2f5dccbdaec2cf173caaeb3f Mon Sep 17 00:00:00 2001 From: William Woodall Date: Wed, 10 Nov 2021 16:39:34 -0800 Subject: [PATCH] document undefined behavior in logging functions Signed-off-by: William Woodall --- rcl/include/rcl/logging_rosout.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rcl/include/rcl/logging_rosout.h b/rcl/include/rcl/logging_rosout.h index 5bbac1bdf..4e42629ad 100644 --- a/rcl/include/rcl/logging_rosout.h +++ b/rcl/include/rcl/logging_rosout.h @@ -158,7 +158,10 @@ rcl_logging_rosout_fini_publisher_for_node( * message out via that publisher. If there is no publisher directly correlated * with the logger then nothing will be done. * - * This function is meant to be registered with the logging functions for rcutils + * This function is meant to be registered with the logging functions for + * rcutils, and shouldn't be used outside of that context. + * Additionally, arguments like args should be non-null and properly initialized + * otherwise it is undefined behavior. * *
* Attribute | Adherence @@ -176,7 +179,8 @@ rcl_logging_rosout_fini_publisher_for_node( * \param[in] args argument for the string format */ RCL_PUBLIC -void rcl_logging_rosout_output_handler( +void +rcl_logging_rosout_output_handler( const rcutils_log_location_t * location, int severity, const char * name,