From 9eaf7c5660c7c3f80342b9af0143e12f147c7af2 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Thu, 22 Oct 2015 15:22:16 -0200 Subject: [PATCH] AP_HAL: add format attribute to panic() --- libraries/AP_HAL/Scheduler.h | 3 ++- libraries/AP_HAL_AVR/Scheduler.h | 2 +- libraries/AP_HAL_Empty/Scheduler.h | 2 +- libraries/AP_HAL_FLYMAPLE/Scheduler.h | 2 +- libraries/AP_HAL_Linux/Scheduler.h | 2 +- libraries/AP_HAL_PX4/Scheduler.h | 2 +- libraries/AP_HAL_SITL/Scheduler.h | 2 +- libraries/AP_HAL_VRBRAIN/Scheduler.h | 2 +- 8 files changed, 9 insertions(+), 8 deletions(-) diff --git a/libraries/AP_HAL/Scheduler.h b/libraries/AP_HAL/Scheduler.h index 48db386fdb..a589450d7c 100644 --- a/libraries/AP_HAL/Scheduler.h +++ b/libraries/AP_HAL/Scheduler.h @@ -4,6 +4,7 @@ #include +#include #include #include "AP_HAL_Boards.h" @@ -56,7 +57,7 @@ public: virtual bool system_initializing() = 0; virtual void system_initialized() = 0; - virtual void panic(const prog_char_t *errormsg, ...) NORETURN = 0; + virtual void panic(const prog_char_t *errormsg, ...) FORMAT(2, 3) NORETURN = 0; virtual void reboot(bool hold_in_bootloader) = 0; /** diff --git a/libraries/AP_HAL_AVR/Scheduler.h b/libraries/AP_HAL_AVR/Scheduler.h index eca8d71faf..e7da4f16ae 100644 --- a/libraries/AP_HAL_AVR/Scheduler.h +++ b/libraries/AP_HAL_AVR/Scheduler.h @@ -45,7 +45,7 @@ public: bool system_initializing(); void system_initialized(); - void panic(const prog_char_t *errormsg, ...) NORETURN; + void panic(const prog_char_t *errormsg, ...) FORMAT(2, 3) NORETURN; void reboot(bool hold_in_bootloader); void set_timer_speed(uint16_t timer_hz); diff --git a/libraries/AP_HAL_Empty/Scheduler.h b/libraries/AP_HAL_Empty/Scheduler.h index f56f338439..9f4c7f9ffd 100644 --- a/libraries/AP_HAL_Empty/Scheduler.h +++ b/libraries/AP_HAL_Empty/Scheduler.h @@ -32,7 +32,7 @@ public: bool system_initializing(); void system_initialized(); - void panic(const prog_char_t *errormsg, ...) NORETURN; + void panic(const prog_char_t *errormsg, ...) FORMAT(2, 3) NORETURN; void reboot(bool hold_in_bootloader); }; diff --git a/libraries/AP_HAL_FLYMAPLE/Scheduler.h b/libraries/AP_HAL_FLYMAPLE/Scheduler.h index cc3ee78592..40af318e3d 100644 --- a/libraries/AP_HAL_FLYMAPLE/Scheduler.h +++ b/libraries/AP_HAL_FLYMAPLE/Scheduler.h @@ -53,7 +53,7 @@ public: bool system_initializing(); void system_initialized(); - void panic(const prog_char_t *errormsg, ...) NORETURN; + void panic(const prog_char_t *errormsg, ...) FORMAT(2, 3) NORETURN; void reboot(bool hold_in_bootloader); private: diff --git a/libraries/AP_HAL_Linux/Scheduler.h b/libraries/AP_HAL_Linux/Scheduler.h index 2861b6f648..29291820db 100644 --- a/libraries/AP_HAL_Linux/Scheduler.h +++ b/libraries/AP_HAL_Linux/Scheduler.h @@ -43,7 +43,7 @@ public: bool system_initializing(); void system_initialized(); - void panic(const prog_char_t *errormsg, ...) NORETURN; + void panic(const prog_char_t *errormsg, ...) FORMAT(2, 3) NORETURN; void reboot(bool hold_in_bootloader); void stop_clock(uint64_t time_usec); diff --git a/libraries/AP_HAL_PX4/Scheduler.h b/libraries/AP_HAL_PX4/Scheduler.h index 2438487671..f03124a40d 100644 --- a/libraries/AP_HAL_PX4/Scheduler.h +++ b/libraries/AP_HAL_PX4/Scheduler.h @@ -60,7 +60,7 @@ public: void suspend_timer_procs(); void resume_timer_procs(); void reboot(bool hold_in_bootloader); - void panic(const prog_char_t *errormsg, ...) NORETURN; + void panic(const prog_char_t *errormsg, ...) FORMAT(2, 3) NORETURN; bool in_timerprocess(); bool system_initializing(); diff --git a/libraries/AP_HAL_SITL/Scheduler.h b/libraries/AP_HAL_SITL/Scheduler.h index b160c842d9..df5827b8c8 100644 --- a/libraries/AP_HAL_SITL/Scheduler.h +++ b/libraries/AP_HAL_SITL/Scheduler.h @@ -41,7 +41,7 @@ public: void system_initialized(); void reboot(bool hold_in_bootloader); - void panic(const prog_char_t *errormsg, ...) NORETURN; + void panic(const prog_char_t *errormsg, ...) FORMAT(2, 3) NORETURN; bool interrupts_are_blocked(void) { return _nested_atomic_ctr != 0; diff --git a/libraries/AP_HAL_VRBRAIN/Scheduler.h b/libraries/AP_HAL_VRBRAIN/Scheduler.h index 6e28dbc63d..cdb6691690 100644 --- a/libraries/AP_HAL_VRBRAIN/Scheduler.h +++ b/libraries/AP_HAL_VRBRAIN/Scheduler.h @@ -39,7 +39,7 @@ public: void suspend_timer_procs(); void resume_timer_procs(); void reboot(bool hold_in_bootloader); - void panic(const prog_char_t *errormsg, ...) NORETURN; + void panic(const prog_char_t *errormsg, ...) FORMAT(2, 3) NORETURN; bool in_timerprocess(); bool system_initializing();