mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
AP_HAL: use noreturn attribute on panic
should reduce coverity warnings
This commit is contained in:
parent
aa7a151fe5
commit
c44ab01be8
@ -17,4 +17,6 @@
|
|||||||
# define constexpr const
|
# define constexpr const
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define NORETURN __attribute__ ((noreturn))
|
||||||
|
|
||||||
#endif // __AP_HAL_MACROS_H__
|
#endif // __AP_HAL_MACROS_H__
|
||||||
|
@ -54,7 +54,7 @@ public:
|
|||||||
virtual bool system_initializing() = 0;
|
virtual bool system_initializing() = 0;
|
||||||
virtual void system_initialized() = 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;
|
virtual void reboot(bool hold_in_bootloader) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -45,7 +45,7 @@ public:
|
|||||||
bool system_initializing();
|
bool system_initializing();
|
||||||
void system_initialized();
|
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 reboot(bool hold_in_bootloader);
|
||||||
|
|
||||||
void set_timer_speed(uint16_t timer_hz);
|
void set_timer_speed(uint16_t timer_hz);
|
||||||
|
@ -32,7 +32,7 @@ public:
|
|||||||
bool system_initializing();
|
bool system_initializing();
|
||||||
void system_initialized();
|
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 reboot(bool hold_in_bootloader);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -53,7 +53,7 @@ public:
|
|||||||
bool system_initializing();
|
bool system_initializing();
|
||||||
void system_initialized();
|
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 reboot(bool hold_in_bootloader);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -43,7 +43,7 @@ public:
|
|||||||
bool system_initializing();
|
bool system_initializing();
|
||||||
void system_initialized();
|
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 reboot(bool hold_in_bootloader);
|
||||||
|
|
||||||
void stop_clock(uint64_t time_usec);
|
void stop_clock(uint64_t time_usec);
|
||||||
|
@ -59,7 +59,7 @@ public:
|
|||||||
void suspend_timer_procs();
|
void suspend_timer_procs();
|
||||||
void resume_timer_procs();
|
void resume_timer_procs();
|
||||||
void reboot(bool hold_in_bootloader);
|
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 in_timerprocess();
|
||||||
bool system_initializing();
|
bool system_initializing();
|
||||||
|
@ -37,7 +37,7 @@ public:
|
|||||||
void system_initialized();
|
void system_initialized();
|
||||||
|
|
||||||
void reboot(bool hold_in_bootloader);
|
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) {
|
bool interrupts_are_blocked(void) {
|
||||||
return _nested_atomic_ctr != 0;
|
return _nested_atomic_ctr != 0;
|
||||||
|
@ -39,7 +39,7 @@ public:
|
|||||||
void suspend_timer_procs();
|
void suspend_timer_procs();
|
||||||
void resume_timer_procs();
|
void resume_timer_procs();
|
||||||
void reboot(bool hold_in_bootloader);
|
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 in_timerprocess();
|
||||||
bool system_initializing();
|
bool system_initializing();
|
||||||
|
Loading…
Reference in New Issue
Block a user