我在多线程c应用程序中发现了这一点.作者评论说它用于在自定义断言函数中使线程崩溃.海湾合作委员会对它很好,但是clang发出以下警告:
note: consider using __builtin_trap() or qualifying pointer with 'volatile'
Run Code Online (Sandbox Code Playgroud)
并且对于assert函数的每次使用,还会发出其中一个:
warning: indirection of non-volatile null pointer will be deleted, not trap
Run Code Online (Sandbox Code Playgroud)
这里发生了什么?__builtin_trap特定于clang?我应该用吗?