mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
bug: add __builtin_unreachable in BUG_ON_HANDLER
This will surpress false gcc warnings like this:
criu/stats.c:85:10: error: array subscript 4 is above array bounds
of 'struct timing[2]' [-Werror=array-bounds]
85 | return &rstats->timings[t];
| ^~~~~~~~~~~~~~~~~~~
criu/stats.c:25:16: note: while referencing 'timings'
25 | struct timing timings[RESTORE_TIME_NS_STATS];
| ^~~~~~~
cc1: all warnings being treated as errors
Signed-off-by: Andrei Vagin <avagin@gmail.com>
This commit is contained in:
parent
4eb43dc4de
commit
9582a44ce1
1 changed files with 1 additions and 0 deletions
|
|
@ -24,6 +24,7 @@
|
|||
pr_err("BUG at %s:%d\n", __FILE__, __LINE__); \
|
||||
__raise(); \
|
||||
*(volatile unsigned long *)NULL = 0xdead0000 + __LINE__; \
|
||||
__builtin_unreachable(); \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue