Go to the source code of this file.
◆ RCUTILS_WARN_UNUSED
#define RCUTILS_WARN_UNUSED __attribute__((warn_unused_result)) |
◆ RCUTILS_THREAD_LOCAL
#define RCUTILS_THREAD_LOCAL _Thread_local |
◆ RCUTILS_STRINGIFY_IMPL
#define RCUTILS_STRINGIFY_IMPL |
( |
|
x | ) |
#x |
◆ RCUTILS_STRINGIFY
◆ RCUTILS_UNUSED
#define RCUTILS_UNUSED |
( |
|
x | ) |
(void)(x) |
◆ RCUTILS_ATTRIBUTE_PRINTF_FORMAT
#define RCUTILS_ATTRIBUTE_PRINTF_FORMAT |
( |
|
format_string_index, |
|
|
|
first_to_check_index |
|
) |
| __attribute__ ((format(printf, format_string_index, first_to_check_index))) |
Macro to annotate printf-like functions which are relying on a format string and a variable number of arguments. This enables GCC to emit warnings if dangerous patterns are detected. See GCC documentation for details: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html
For the following function: int snprintf(char *str, size_t size, const char *format, ...); ^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ ^^^ ARG 1 ARG 2 ARG 3 ARG 4 format string first optional argument
format_string_index value would be 3, first_to_check_index value would be 4.
IMPORTANT: the first argument has an index of ONE (not zero!).
- Parameters
-
format_string_index | index of the format string passed to the function |
first_to_check_index | index of the first "optional argument" |