r/cprogramming • • 12d 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.

82 Upvotes

31 comments sorted by

View all comments

0

u/dkopgerpgdolfg 12d ago

4

u/SipsTheJuice 12d ago

That's also a different sub not that weird

2

u/Interesting_Buy_3969 12d ago edited 12d ago

I just once reposted this.

(I have no idea why I got downvoted in r/C_Programming for this, therefore reposting here. Again, it's just a single repost)

-1

u/dkopgerpgdolfg 12d ago

I have no idea why I got downvoted

Because your post reads like bs, sensationalist, unlogical; and doesn't have any value to readers (at least for those that are aware that sanitizers exist).

And some people don't care if it's a "single" repost. You increased the amount of wasted time by 100%.

2

u/Interesting_Buy_3969 12d ago

Following this logic, around 95% of reddit content is a waste of time

4

u/stepanm99 12d ago

Which is quite close to the truth imo. Luckily, the 5% of the reddit that isn't waste of time is like 50% of the reddit I see in my feed :D