6 ms·
> No. It's undefined behaviour, it may do anything or nothing. This is clearly nonsense.
by iambvk 10mo ago
> No. It's undefined behaviour, it may do anything or nothing.
This is clearly nonsense.
- quotemstr 10mo agoIt is not nonsense: see https://lwn.net/Articles/575563/ https://lwn.net/Articles/575563/ Compilers are allowed to assume undefined behavior doesn't happen, and dereferencing an invalid pointer is undefined behavior. You don't have to like it, but that's how it is.
- lmm 10mo ago> This is clearly nonsense. It is indeed. Unfortunately it's also the C language standard.