From 90523ae975dc1f796171711e99b207efa127435d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 9 Jan 2013 20:41:37 +1100 Subject: [PATCH] AP_HAL: added WARN_IF_UNUSED macro useful for key functions --- libraries/AP_HAL/AP_HAL.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/AP_HAL/AP_HAL.h b/libraries/AP_HAL/AP_HAL.h index 023cf19421..71ab8cf043 100644 --- a/libraries/AP_HAL/AP_HAL.h +++ b/libraries/AP_HAL/AP_HAL.h @@ -8,6 +8,12 @@ #include "AP_HAL_Namespace.h" #include "AP_HAL_Boards.h" +#ifdef __GNUC__ + #define WARN_IF_UNUSED __attribute__ ((warn_unused_result)) +#else + #define WARN_IF_UNUSED +#endif + /* HAL Module Classes (all pure virtual) */ #include "UARTDriver.h" #include "I2CDriver.h"