3 ms·
It's not always obvious that you're mixing signed and unsigned, though. I think the biggest source of these kinds of bugs is because size_t is unsigned but ptr
by int_19h 4y ago
It's not always obvious that you're mixing signed and unsigned, though.
I think the biggest source of these kinds of bugs is because size_t is unsigned but ptrdiff_t is signed. So the moment you mix pointer subtraction with sizeof, footguns abound.