News for hackers. Stuff that matters.
Re:Checked C: Making C Safer by Extension by Someone on Sunday September 09, 2018 @03:23AM (#17944779)
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.

Re:Checked C: Making C Safer by Extension by ainar-g on Sunday September 09, 2018 @05:25AM (#17945098)
Re. 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;
  }
Re:Checked C: Making C Safer by Extension by dang on Sunday September 09, 2018 @04:16AM (#17944926)
Ok, we've squeezed in an 'r'.
Re:Checked C: Making C Safer by Extension by vmchale on Sunday September 09, 2018 @11:28PM (#17949207)
> integer under/overflow

very few languages actually solve this completely. you'd need refinement types to do so.