Elektrine lite

← Feed

@datenwolf@chaos.social

Post #3213190

2023-11-03 21:14 UTC

@thephd@pony.social All true and right. Yet, I still long for C compilers to just *tell* me (as a warning, that I can lift to an error), if code gets optimized away, that was "proven" to have no side effects, or is considered "redundant" within what's considered defined behavior. If I write int something(...) { char b[32]; /* ... */ memset(b, 0, sizeof(b)); return 0; } and the compiler optimizes away that memset, because "d'uh", then please tell me.

Replies (1)