r/cprogramming • • Oct 07 '26

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

4

u/vip17 Oct 07 '26

How long have you been in the software industry and how long of that is in complex software? Have you heard that many governments suggest a memory safe language like Rust, Go or C# for a reason?

4

u/Nothing_from_void Oct 07 '26

it's a joke

2

u/SeriousPlankton2000 Oct 08 '26

Here we take jokes very seriously.

4

u/arjuna93 Oct 08 '26

Governments generally suck at anything, so choice of languages is unsurprising

1

u/Illustrious-Eagle531 Oct 13 '26

The UK government were talking about mandating OpenCPI for all land CEMA projects, which tells you everything you need to know about their understanding of how to develop functional information systems.

1

u/margielafarts Oct 08 '26

most devs that work in govt are mediocre at best.

1

u/Real-Abrocoma-2823 Oct 11 '26 • Bravo

Most are mediocre because that's what mediocre means.

1

u/Entire_Brush_2698 Oct 13 '26

not very long i guess….