Skip to content

Commit 9e1a2b2

Browse files
committed
panic: noreturn attribute for scan build
Add noreturn attribute to decrease number of false positives when using assert / panic. Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
1 parent 1ff2760 commit 9e1a2b2

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/include/sof/debug/panic.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@
2020
void dump_panicinfo(void *addr, struct sof_ipc_panic_info *panic_info);
2121
void panic_rewind(uint32_t p, uint32_t stack_rewind_frames,
2222
struct sof_ipc_panic_info *panic_info, uintptr_t *data);
23+
#if __clang_analyzer__
24+
void __panic(uint32_t p, char *filename, uint32_t linenum)
25+
__attribute__((analyzer_noreturn));
26+
#else
2327
void __panic(uint32_t p, char *filename, uint32_t linenum);
28+
#endif
2429

2530
/* panic dump filename and linenumber of the call */
2631
#define panic(x) __panic((x), (RELATIVE_FILE), (__LINE__))

0 commit comments

Comments
 (0)