mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 16:42:32 +00:00
Merge pull request #14414 from opensourcerouting/coverity-assume
lib: another attempt at Coverity false positives
This commit is contained in:
commit
7e1eb2a1e0
@ -122,6 +122,14 @@ extern "C" {
|
|||||||
#define assume(x)
|
#define assume(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __COVERITY__
|
||||||
|
/* __coverity_panic__() is named a bit poorly, it's essentially the same as
|
||||||
|
* __builtin_unreachable(). Used to eliminate false positives.
|
||||||
|
*/
|
||||||
|
#undef assume
|
||||||
|
#define assume(x) do { if (!(x)) __coverity_panic__(); } while (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
/* for helper functions defined inside macros */
|
/* for helper functions defined inside macros */
|
||||||
#define macro_inline static inline __attribute__((unused))
|
#define macro_inline static inline __attribute__((unused))
|
||||||
#define macro_pure static inline __attribute__((unused, pure))
|
#define macro_pure static inline __attribute__((unused, pure))
|
||||||
|
Loading…
Reference in New Issue
Block a user