Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Commit

Permalink
assert: silence compiler warning for NDEBUG
Browse files Browse the repository at this point in the history
_Analysis_assume_(expression) is removed by precompiler and statements
like: if (test) stdex_assert(expr); resolved to: if (test) ;

Remains to be seen if Xcode is happy with this change.

Signed-off-by: Simon Rozman <[email protected]>
  • Loading branch information
rozmansi committed Jun 10, 2024
1 parent ef829b0 commit 351fd6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/stdex/assert.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <stdlib.h>

#ifdef NDEBUG
#define stdex_assert(e) _Analysis_assume_(e)
#define stdex_assert(e) { _Analysis_assume_(e); ((void)0); }
#define stdex_verify(e) ((void)(e))
#else
#if defined(_WIN32)
Expand Down

0 comments on commit 351fd6b

Please sign in to comment.