|
|
|
|
|
by Nursie
4428 days ago
|
|
I've been looking at this recently, part of the problem with that approach is that compilers will often optimise out an overwrite if they can't see anything happening afterwards. For instance if you set a stack-resident buffer that contained a key to all zeros using memset, then simply exit the scope, most optimisations will detect it as unnecessary (wtf? this never gets read back, who cares?) and ditch the line. Search for memset_s (part of the C11 standard) for a clear function that can survive optimisers. |
|