Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/linux/sys/osal_cc.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ extern "C" {
#define CLANG_ANALYZER_NORETURN
#endif

static inline void cc_assert (int exp) CLANG_ANALYZER_NORETURN
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, the wrapper exists to be able to add the LCOV_EXCL_LINE exclusion marker. Without you must also trigger the assertion for full coverage.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like a CLANG error?

The function used on linux is this:

extern void __assert_fail (const char *__assertion, const char *__file,
			   unsigned int __line, const char *__function)
     __THROW __attribute__ ((__noreturn__));

It's decorated by noreturn already which should be a harder form.

The Clang-specific ‘analyzer_noreturn’ attribute is almost identical to ‘noreturn’ except that it is ignored by the compiler for the purposes of code generation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah vänta du menade LCOV_EXCL_LINE. Sorry. Ja den är ju något annat.

{
assert (exp); // LCOV_EXCL_LINE
}

#define CC_PACKED_BEGIN
#define CC_PACKED_END
#define CC_PACKED __attribute__ ((packed))
Expand Down Expand Up @@ -83,7 +78,7 @@ static inline void cc_assert (int exp) CLANG_ANALYZER_NORETURN
#define CC_ATOMIC_SET32(p, v) __atomic_store_n ((p), (v), __ATOMIC_SEQ_CST)
#define CC_ATOMIC_SET64(p, v) __atomic_store_n ((p), (v), __ATOMIC_SEQ_CST)

#define CC_ASSERT(exp) cc_assert (exp)
#define CC_ASSERT(exp) assert (exp)

#ifdef __cplusplus
#define CC_STATIC_ASSERT(exp) static_assert (exp, "")
Expand Down