Unsafe Rust versus C and C++
Unsafe Rust versus C and C++
Posted Feb 5, 2025 18:34 UTC (Wed) by excors (subscriber, #95769)In reply to: Unsafe Rust versus C and C++ by Trainninny
Parent article: Resistance to Rust abstractions for DMA mapping
Ah, I think I was mixing up C and C++ - it seems it is generally agreed to be undefined behaviour in C++ (though still allowed by GCC), but probably is allowed in C. Though as that Stack Overflow discussion shows, the C standard is somewhat self-contradictory and vague enough (outside of non-normative footnotes) that I'm not sure anyone can be entirely certain of the intended semantics, and especially can't be certain they'll interpret it the same way as all compiler developers.