logoalt Hacker News

saagarjhatoday at 1:03 AM2 repliesview on HN

No, the code that does this is always active


Replies

aw1621107today at 8:03 AM

Shouldn't control flow diverge if the assert is triggered when NDEBUG is not defined? Pretty sure assert is defined to call abort when triggered and that is tagged [[noreturn]].

show 1 reply
gottheUIbluestoday at 1:20 AM

Right so strictly speaking C++ could do anything here when passed a null pointer, because even though assert terminates the program, the C++ compiler cannot see that, and there is then undefined behaviour in that case

show 1 reply