| ▲ | uecker 19 hours ago | |||||||||||||
Any tutorial for C should explain compiler warnings and other tools that help make code safer. In C, you do not rely on the language specification but on tooling. Especially for Rust programmers, this needs to be explained more explicitly. And of course, you can build abstractions using types in C. So a tutorial should also focus on that, and perhaps not start with a low-level string reversal function. | ||||||||||||||
| ▲ | swinglock 17 hours ago | parent | next [-] | |||||||||||||
Absolutely. Turn the warnings into errors too, build and test with sanitizers (ASAN, UBSAN, TSAN) when not measuring performance, and use static analysis beyond compiler warnings (Clang Tidy, Clang Static Analyzer). Though the author doesn't look to be trying to write a great tutorial, rather prioritizing sharing what and how they learned something from their perspective. | ||||||||||||||
| ||||||||||||||
| ▲ | deknos 7 minutes ago | parent | prev | next [-] | |||||||||||||
build one. i would verify gladyly | ||||||||||||||
| ▲ | bjackman 18 hours ago | parent | prev | next [-] | |||||||||||||
> This is not a substitute for a proper C tutorial | ||||||||||||||
| ▲ | kingforaday 18 hours ago | parent | prev | next [-] | |||||||||||||
I'm with you. Since the post already shows Clang catching the array-decay bug, the author could even just add a “always build with -Wall -Wextra -fsanitize=address,undefined” note and some explanation of course. | ||||||||||||||
| ||||||||||||||
| ▲ | gerdesj 8 hours ago | parent | prev | next [-] | |||||||||||||
A Rust programmer, programming in C is a C programmer! Tribalism is sooo ... sadly now. Please don't. | ||||||||||||||
| ▲ | jminnl 17 hours ago | parent | prev [-] | |||||||||||||
Asan! | ||||||||||||||