From ecc3cb537726c2ca7fc3fcf15d9c0e4be6d92189 Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Wed, 9 Jan 2019 15:50:15 -0800 Subject: [PATCH] Add parentheses around use of zerouuid macro (#371) Otherwise the preprocessor may gobble up the commas in mistake of extra parameters when it is passed to uuidcmpzero. cppcheck v1.86 was complaining about this line. --- rcl_action/include/rcl_action/types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rcl_action/include/rcl_action/types.h b/rcl_action/include/rcl_action/types.h index 58a300e..21358a3 100644 --- a/rcl_action/include/rcl_action/types.h +++ b/rcl_action/include/rcl_action/types.h @@ -57,7 +57,7 @@ extern "C" #define UUID_SIZE 16 #define uuidcmp(uuid0, uuid1) (0 == memcmp(uuid0, uuid1, UUID_SIZE)) #define zerouuid (uint8_t[UUID_SIZE]) {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} -#define uuidcmpzero(uuid) uuidcmp(uuid, zerouuid) +#define uuidcmpzero(uuid) uuidcmp(uuid, (zerouuid)) // Forward declare typedef struct rcl_action_server_t rcl_action_server_t;