5 ms·
People who know how to use C rarely if ever have problems with undefined behavior. I particularly have written a huge amount of C code and my bugs have never be
by coliveira 3y ago
People who know how to use C rarely if ever have problems with undefined behavior. I particularly have written a huge amount of C code and my bugs have never been related to undefined behavior. This is an idea that has been spread to make people even more afraid of using C/C++. While there is a possibility of finding these problems, in practice it is almost a non-issue.
- tejuis 3y agoSame here, no problems with undefined behavior. Also, no memory issues either after done with code finalization using Valgrind.
- kaba0 3y ago“no memory issues in the tested state space”. That’s the only thing Valgrind can say. But it says nothing how a run with different input would behave, it just might segfault/leak/use after free/UB.
- coliveira 3y agoThat is always the case in any platform. Just because something works on a Mac it will not necessarily work on a PC or vice-versa. If a language has multiple compilers, you also need to test in different compilers to make sure your code works there too. You're trying to make this as a C-only issue, when it is a general issue, maybe with different names.
- flohofwoe 3y agoTBF, did you ever run your code with UBSAN enabled? There's a couple of UB cases which don't trigger any bugs until one of the popular C compilers changes some details in their optimizer passes, and which then only manifest with a specific combination of compiler options.
- oblio 3y ago> People who know how to use C rarely if ever have problems with I think we call this "No True Scotsman". In real life lots of people write C because they want to or have to and they generate tons of bugs from bug classes that just aren't present at all in other languages.
- DumbStarbucks 3y ago> People who know how to use C rarely if ever have problems with undefined behavior. I think the CVE database would disagree with that statement.