3 ms·
This does nothing for use-after-free or integer under/overflow, so “Making C SafeR by Extension” would be a better title. It’s good to see people attempting th
by Someone 8y ago
This does nothing for use-after-free or integer under/overflow, so “Making C SafeR by Extension” would be a better title.
It’s good to see people attempting this, though. I would think chances are good Microsoft will use it internally, and that already would be a win. Also, it’s a clang/LLVM extension. That makes it easier for third parties to start using it.
On the other hand, their choice to use Ptr<T> for familiarity with C++ requires users who want to keep their code compatible with C compilers that don’t support this a bit harder (it will require wrapping that in some macro, say _ptrTo(T)). That isn’t ideal for adoption in open source programs.
- dang 8y agoOk, we've squeezed in an 'r'.
- ainar-g 8y agoRe. syntax. I don't understand, why can't they just make _Ptr an attribute like _Atomic, and provide a header <stdchecked.h>. That is, #include <stdchecked.h> void read_next(int *b, int idx, checked int *out) { int tmp = *(b+idx); *out = tmp; }
- vmchale 8y ago> integer under/overflow very few languages actually solve this completely. you'd need refinement types to do so.