Comment by sitkack

1 day ago

Relying on implementation behavior is the perfect way to introduce a hidden in plain site vulnerability.

Most of C++ programs written before P0593R6 depended on implementation behaviour, and were graciously allowed to not be undefined behaviour just 5 years ago. C++ as a language standard is mostly irrelevant, what one should care about is what the compiler authors consider valid code.

Using pragmas, attributes and optimisation guarantees is the point of implementation-defined behaviour in the first place.

The Linux kernel extensively uses gcc extensions. That doesn't inherently make it insecure.

You have to rely on implementation for anything to do with what happens to memory after it is freed, or really almost anything to do with actual bytes in RAM.