Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Only if the assert is active. It basically means that the code is invalid when NDEBUG is set.


When NDEBUG is set, there is no test, no assertion, at all. So yes, this code has UB if you set NDEBUG and then pass it a null pointer — but that's obvious. The code does exactly what it looks like it does; there's no tricks or time travel hiding here.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: