3 ms·
That's a very good example. I think that's what I meant by: > "Sound" code is safe code (that may or may not be checked by the compiler), that will remain safe
by codeflo 4y ago
That's a very good example. I think that's what I meant by:
> "Sound" code is safe code (that may or may not be checked by the compiler), that will remain safe no matter how it's called by checked code.
Maybe "called" was too specific, it could be embedded in other ways. But it's clear in your example that there's a way of integrating the unsafe cast into otherwise fully checked code that leads to UB. Hence, it is not sound.