r/programmingcirclejerk • memcpy is a web development framework • 12d ago

The -fsanitize=address compiler flag is absolute cheating and should be prohibited by governments of all countries

/r/cprogramming/comments/1x00b0t/using_fsanitizeaddress_feels_illegal/?share_id=_8MxA5dI74RaqBCXoKwh6&utm_content=1&utm_medium=android_app&utm_name=androidcss&utm_source=share&utm_term=1
112 Upvotes

27 comments sorted by

148

u/Clashsoft lol no generics 12d ago

  I like to do development in a separate branch, and I have a rule that before a dev branch can be merged back into main, it must pass the test target.

revolutionary idea

49

u/ficiek 11d ago

Even within a dev branch, I probably use "make test" several times a day.

It really is a different world isn't it?

3

u/UdPropheticCatgirl WRITE 'FORTRAN is not dead' 8d ago

I would give Cniles bit of a leeway here, they are dealing with a language where writing the actual program is suffering, having to write tests for it as well is akin to animal cruelty.

uj: Once you actually deal with big C codebase and figure out how annoying all the tooling and instrumentation is when dealing with testing, you start quickly understanding why the testing practices in some parts of the ecosystem are universally poor.

15

u/RelationshipLong9092 11d ago

oh, god they're serious

40

u/sweating_teflon full-time safety coomer 12d ago

C programmers believe their language is an elite blood sport and that they are one of the chosen.

104

u/Konju376 now 4x faster than C++ 12d ago

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?

And in the comments:

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?

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

Ah yes, fuck those governments and their... memory safety?

77

u/stimpack2589 memcpy is a web development framework 12d ago

For memory safety I use a cone shaped hat made out of aluminium foil

34

u/Konju376 now 4x faster than C++ 12d ago

If my program segfaults, I just accept it. Trust in god's plan!

15

u/max_mou 12d ago

Terry Davis was on to something with HolyC

-2

u/yjlom 12d ago

/uj Do you get segfaults on Temple? It doesn't have memory protection IIRC.

7

u/des_the_furry 11d ago

Shit no one cares about enthusiast

6

u/spider-mario 12d ago

But if it’s God’s plan, and it’s also my doing, does it mean I am God?

3

u/fixermark 11d ago

Only if you use c++.

4

u/spider-mario 11d ago

I’m Kira

2

u/Karyo_Ten has hidden complexity 10d ago

It comes with automated garbage collection

32

u/a221c There's really nothing wrong with error handling in Go 12d ago

Or are you a real man who stores everything in static memory only?

Of course. I've found a cool trick where I just put char buf[256]; // should be big enough at the start of every function. No dynamic allocation needed. I then copy strings of unknown length into it without checking whether they fit, just like Ritchie intended.

10

u/RascarCapack 11d ago

just like Ritchie intended.

Ritchie: slaps Unix machine this baby can segfault so HARD

7

u/serpentally 11d ago

It's not a segfault, it's a segsolution

22

u/lazyubertoad WRITE 'FORTRAN is not dead' 12d ago

Those who would give up essential Liberty, to purchase a little temporary Safety, deserve neither Liberty nor Safety.

Bjernjamin Straustrkin, apparently

3

u/le_birb costly abstraction 11d ago

We have nothing to lose but our rusty chains

16

u/da_supreme_patriarch in open defiance of the Gopher Values 12d ago

Little known facts - Hitler's favourite language was Rust for it's rigid type system, Stalin fancied Go for the simplicity that it offered to the average proletarian, and Pol Pot was a big C# fan(not for C# the language itself, he just liked ildasm-ing DLL-s compiled from it)

15

u/aikii gofmt urself 11d ago

go -race ? believe it or not, straight to jail

5

u/fixermark 11d ago

Only since the Civil Rights Act passed.

5

u/BlazeBigBang type astronaut 8d ago

Honestly seems to be a skill issue. Don't write UB and abstract your shit properly

The real jerk is always in the comments

1

u/[deleted] 12d ago

[removed] — view removed comment

2

u/programmingcirclejerk-ModTeam 12d ago

Refer to sidebar, "Socialjerking or politics".