kiri@ani.social to Programmer Humor@programming.dev · edit-21 day agoC++ani.socialimagemessage-square73fedilinkarrow-up1688arrow-down113file-text
arrow-up1675arrow-down1imageC++ani.socialkiri@ani.social to Programmer Humor@programming.dev · edit-21 day agomessage-square73fedilinkfile-text
minus-squareSorryQuicklinkfedilinkarrow-up4arrow-down2·edit-216 hours agoThe whole point of a segfault is that you can’t really know anything about it. Even in rust, when you get a segfault there is no meaningful error.
minus-squareWhyJiffie@sh.itjust.workslinkfedilinkEnglisharrow-up5arrow-down2·4 hours agopoint is, Rust manages to give you not a segfault but a meaningful error almost all the time until you use unsafe
minus-squareSorryQuicklinkfedilinkarrow-up1arrow-down1·2 hours agoIf you’re getting a segfault in C++, it’s also cause you used unsafe code. It’s just not officially enclosed in an “unsafe” block.
The whole point of a segfault is that you can’t really know anything about it. Even in rust, when you get a segfault there is no meaningful error.
point is, Rust manages to give you not a segfault but a meaningful error almost all the time until you use unsafe
If you’re getting a segfault in C++, it’s also cause you used unsafe code. It’s just not officially enclosed in an “unsafe” block.