Skip to content

Commit

Permalink
warn about unused return value for set_logger_level
Browse files Browse the repository at this point in the history
Signed-off-by: Dirk Thomas <[email protected]>
  • Loading branch information
dirk-thomas committed May 15, 2020
1 parent 3f443e3 commit 817dc0f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
9 changes: 9 additions & 0 deletions rcl/include/rcl/logging_external_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
#include "rcl/types.h"
#include "rcl/visibility_control.h"

#ifdef __cplusplus
extern "C" {
#endif

/// Initialize the external logging library.
/**
* \param[in] config_file The location of a config file that the external
Expand Down Expand Up @@ -78,6 +82,11 @@ rcl_logging_external_log(int severity, const char * name, const char * msg);
* \return RCL_RET_ERROR if an unspecified error occurs.
*/
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_ret_t rcl_logging_external_set_logger_level(const char * name, int level);

#ifdef __cplusplus
}
#endif

#endif // RCL__LOGGING_EXTERNAL_INTERFACE_H_
8 changes: 2 additions & 6 deletions rcl/include/rcl/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,10 @@ extern "C"
{
#endif

#ifndef _WIN32
/// Ignored return values of functions with this macro will emit a warning.
# define RCL_WARN_UNUSED __attribute__((warn_unused_result))
#else
# define RCL_WARN_UNUSED _Check_return_
#endif
#define RCL_WARN_UNUSED RCUTILS_WARN_UNUSED

#define RCL_UNUSED(x) (void)(x)
#define RCL_UNUSED(x) RCUTILS_UNUSED(x)

#ifdef __cplusplus
}
Expand Down

0 comments on commit 817dc0f

Please sign in to comment.