3 ms·
Well, yes, I'd like to do that, but programmers make mistakes and it isn't easy to test. Also, you can't reasonably remove all undefined behaviour. In C++ you
by CJefferson 3y ago
Well, yes, I'd like to do that, but programmers make mistakes and it isn't easy to test.
Also, you can't reasonably remove all undefined behaviour. In C++ you basically can't do file IO without undefined behaviour.
- knorker 3y agoAs a fellow UB nitpicker, I'd like to hear more about your favorite UB triggers. E.g. in the space of file IO.
- CJefferson 3y agoThe C++ filesystem section contains the following, which basically means you can’t do safe IO when other programs are running in the same computer: “ The behavior is undefined if the calls to functions in this library introduce a file system race, that is, when multiple threads, processes, or computers interleave access and modification to the same object in a file system.”
- torstenvl 3y agoI'm not sure that means much, since that's true of literally every language that does file I/O.