by ncmncm · 4y ago · 0 comments
There "are always ways", but not everybody always knows what they are, or even knows they need to know them. And, what you think ought to suffice too often does not.
For example, in
void f() {
volatile char sekrit[256];
sekrit[0] = 0;
}
a compiler may reason that, since sekrit is on the stack, and no hardware device could know where it is, it may elide the whole block. And, some do.Sometimes you have to put the zeroing code in its own .o file so the caller's compiler won't know what it does.