Checked C adds new types to C:
• ptr<T>, the checked pointer to singleton type,
• array_ptr<T>, the checked pointer to array type,
• T checked[N], the checked array type,
Many people have been down that road. GCC had "fat pointers" for subscript checking years ago.[1] That never caught on. Walter Bright had a proposal.[2] I had a proposal. Microsoft had "Managed C++". It's technically possible, but retrofitting old code rarely happens.[1] http://williambader.com/bounds/example.html [2] https://news.ycombinator.com/item?id=8509155