C 断言使用
静态断言 _Static_assert
static-assert-in-c
_Static_assert(sizeof(long)==7, this_should_be_true)
build fail
sas.c:4: error: size of array ‘static_assertion_this_should_be_true’ is negative
#define _Static_assert(COND,MSG) typedef char static_assertion_##MS
原创
2021-01-21 22:05:07 ·
1060 阅读 ·
1 评论