logoalt Hacker News

TinkersWyesterday at 7:13 PM3 repliesview on HN

That is actually memory safe, as null will always trigger access violation..

Anyway safety checked modes are sufficient for many programs, this article claims otherwise but then contradicts itself by showing that they caught most issues using .. safety checked modes.


Replies

steveklabnikyesterday at 7:15 PM

It is undefined behavior. You cannot make a claim about what it will always do.

maccardyesterday at 7:22 PM

>null will always trigger access violation..

No, it won't. https://gcc.godbolt.org/z/Mz8sqKvad

show 1 reply
wild_pointeryesterday at 7:31 PM

You didn't read this, did you? https://alexgaynor.net/2019/apr/21/modern-c++-wont-save-us/

It's not a pointer.