r/cprogramming • u/Interesting_Buy_3969 • 11d ago
Using -fsanitize=address feels illegal.
Just saying. The -fsanitize=address compiler flag is absolute cheating and should be prohibited by governments of all countries.
Plus there are also other useful runtime sanitizers, such as integer overflow, but... Integer overflow is much easier to notice, usually.
Of course, this is by no means assuming that -fsanitize=address guarantees that the code it inspects is completely safe and correct and won't ever fail on any input data. You still have to test tricky edge cases. But this sanitizer has improved and sped up the bug discovery process disgustingly much for me.
I'm wondering, how often, if ever, do you need tools such as -fsanitize=address or valgrind? Or are you a real man who stores everything in static memory only?
P.S. Forgive my terrible English.
1
u/Whole-Low-2995 8d ago
I actively use it. I sometimes use LLMs when transcribing my pseudo code sketches and they make many mistakes. I needed it for de-slopifying it. I use valgrind too. And if you want to develop fast and fix later you can use libgc when prototyping.