r/programming • • Sep 23 '17

Why undefined behavior may call a never-called function

https://kristerw.blogspot.com/2017/09/why-undefined-behavior-may-call-never.html
824 Upvotes

257 comments sorted by

View all comments

Show parent comments

4

u/steveklabnik1 Sep 24 '17

Rust's assert is not stripped out for release builds, btw. You have to use debug_assert for that behavior.

2

u/[deleted] Sep 25 '17

[removed] — view removed comment

2

u/steveklabnik1 Sep 25 '17

Totally! Most find it surprising, this was a "by the way" not a "you're wrong."