Re:The Use of assert() in SQLite
by masklinn on Saturday April 27, 2019 @02:30AM
(#19764142)
> I believe that could be trivially fixed by giving functions proper names that indicate what they do or what they are intended for. For example, calling such an optimised-away assertion function `debug_only_assert()` would immediately rule out such unintentional misuse.
That is Rust's tack:
> [assert!] assertions are always checked in both debug and release builds, and cannot be disabled.
> Unlike assert!, debug_assert! statements are only enabled in non optimized builds by default. An optimized build will omit all debug_assert! statements unless -C debug-assertions is passed to the compiler.
That is Rust's tack:
> [assert!] assertions are always checked in both debug and release builds, and cannot be disabled.
> Unlike assert!, debug_assert! statements are only enabled in non optimized builds by default. An optimized build will omit all debug_assert! statements unless -C debug-assertions is passed to the compiler.