AP_HAL: use noreturn attribute on panic

should reduce coverity warnings
This commit is contained in:
Andrew Tridgell 2015-06-06 09:08:28 +10:00
parent aa7a151fe5
commit c44ab01be8
9 changed files with 10 additions and 8 deletions

View File

@ -17,4 +17,6 @@
# define constexpr const
#endif
#define NORETURN __attribute__ ((noreturn))
#endif // __AP_HAL_MACROS_H__

View File

@ -54,7 +54,7 @@ public:
virtual bool system_initializing() = 0;
virtual void system_initialized() = 0;
virtual void panic(const prog_char_t *errormsg) = 0;
virtual void panic(const prog_char_t *errormsg) NORETURN = 0;
virtual void reboot(bool hold_in_bootloader) = 0;
/**

View File

@ -45,7 +45,7 @@ public:
bool system_initializing();
void system_initialized();
void panic(const prog_char_t *errormsg);
void panic(const prog_char_t *errormsg) NORETURN;
void reboot(bool hold_in_bootloader);
void set_timer_speed(uint16_t timer_hz);

View File

@ -32,7 +32,7 @@ public:
bool system_initializing();
void system_initialized();
void panic(const prog_char_t *errormsg);
void panic(const prog_char_t *errormsg) NORETURN;
void reboot(bool hold_in_bootloader);
};

View File

@ -53,7 +53,7 @@ public:
bool system_initializing();
void system_initialized();
void panic(const prog_char_t *errormsg);
void panic(const prog_char_t *errormsg) NORETURN;
void reboot(bool hold_in_bootloader);
private:

View File

@ -43,7 +43,7 @@ public:
bool system_initializing();
void system_initialized();
void panic(const prog_char_t *errormsg);
void panic(const prog_char_t *errormsg) NORETURN;
void reboot(bool hold_in_bootloader);
void stop_clock(uint64_t time_usec);

View File

@ -59,7 +59,7 @@ public:
void suspend_timer_procs();
void resume_timer_procs();
void reboot(bool hold_in_bootloader);
void panic(const prog_char_t *errormsg);
void panic(const prog_char_t *errormsg) NORETURN;
bool in_timerprocess();
bool system_initializing();

View File

@ -37,7 +37,7 @@ public:
void system_initialized();
void reboot(bool hold_in_bootloader);
void panic(const prog_char_t *errormsg);
void panic(const prog_char_t *errormsg) NORETURN;
bool interrupts_are_blocked(void) {
return _nested_atomic_ctr != 0;

View File

@ -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);
void panic(const prog_char_t *errormsg) NORETURN;
bool in_timerprocess();
bool system_initializing();