4 ms·
This is a 10-line example. In real-world code you will get a segfault and then have to hunt through the codebase with a debugging session to figure out where it
by yawaramin 3y ago
This is a 10-line example. In real-world code you will get a segfault and then have to hunt through the codebase with a debugging session to figure out where it triggered.
- CyberDildonics 3y agohttps://devblogs.microsoft.com/cppblog/new-code-analysis-checks-in-visual-studio-2019-use-after-move-and-coroutine/ https://devblogs.microsoft.com/cppblog/new-code-analysis-che... Actually it would trigger the first time you use something after moving and it's pretty obvious what happened because the data structure will have null pointers. This is very rare and usually just due to a typo in practice because moving a variable in the middle of function is mostly to pass it to another function as an argument so it will be cleaned up when the function is done. How often does this happen to you? Do you work in modern C++? I've never heard of this actually tripping anyone up.
- yawaramin 3y agoIt's kinda funny to link to a static analysis developed expressly to check for this issue and then claim that the issue isn't a problem in practice, don't you think?
- CyberDildonics 3y agoIt isn't a problem in practice. I think the static analysis just comes from seeing if they can mimic rust and really nail it down. Just because someone does some static analysis doesn't they are solving a problem that's plaguing people.