logoalt Hacker News

mohinderyesterday at 7:59 PM1 replyview on HN

> This would neither pass a review, nor static analysis

I beg to differ. Humans are fallible. Static analysis of C++ cannot catch all cases and humans will often accept a change that passes the analyses.


Replies

einpoklumyesterday at 8:29 PM

> Static analysis of C++ cannot catch all cases

You're ignoring how static analysis can be made to err on the side of safety rather than promiscuity.

Specifically, for optional dereferencing, static analysis can be made to disallow it unless it can prove the optional has a value.