8 karma · joined Jan 29, 2024 (2y ago) · 5 submissions
comment 2y ago · link · parent
I think you didn't understand - what I was implying is to leave the asserts in for a release build, because they (theoretically) never happen, because they are free optimization hints.
So effectively, instead of a macro, your asserts become controlled by the presence of sanitizers.
I think it's nice because it lets you keep the same definition for both debug and release.
comment 2y ago · link · parent
Another feature of asserts is that `-DNDEBUG` disables them.
comment 2y ago · link · parent
Also, code after __builtin_trap() is treated as dead.