4 ms·
just make a type where doing pointer math and other such use cases are a compiler error?
by m_mueller 9y ago
just make a type where doing pointer math and other such use cases are a compiler error?
- adrianN 9y agoJust use a language where types automatically know their size? I thought the point was to make existing code safer by exploiting information that's already there (e.g. the allocator knowing the size of things on the heap).
- m_mueller 9y agoThe point is that C could be made much safer to use with a few "simple" (at least seemingly) tweaks. C has great tooling support on all platforms, including embedded, so it would be a compelling advancement if the language standard were to include such a thing. The important thing would be to coerce such a string type to character arrays so it remains compatible with all libraries without casting.