Re:“C is quirky, flawed, and an enormous success” – Dennis R...
by coliveira on Sunday July 09, 2023 @09:04AM
(#36654152)
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.
[ Parent
| on HN ]
Re:“C is quirky, flawed, and an enormous success” – Dennis R...
by tejuis on Sunday July 09, 2023 @10:05AM
(#36654530)
Same here, no problems with undefined behavior. Also, no memory issues either after done with code finalization using Valgrind.
Re:“C is quirky, flawed, and an enormous success” – Dennis R...
by kaba0 on Monday July 10, 2023 @02:40AM
(#36662846)
“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.
Re:“C is quirky, flawed, and an enormous success” – Dennis R...
by coliveira on Thursday July 13, 2023 @01:43PM
(#36713113)
That 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.
Re:“C is quirky, flawed, and an enormous success” – Dennis R...
by flohofwoe on Sunday July 09, 2023 @10:15AM
(#36654604)
TBF, 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.
Re:“C is quirky, flawed, and an enormous success” – Dennis R...
by oblio on Sunday July 09, 2023 @01:45PM
(#36656821)
> 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.
Re:“C is quirky, flawed, and an enormous success” – Dennis R...
by DumbStarbucks on Sunday July 09, 2023 @04:33PM
(#36658575)
> 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.