3 ms·
I had always assumed it was because of backwards compat that the proposal was never accepted but since it turns out that is not the issue, do you have any idea
by cassepipe 4y ago
I had always assumed it was because of backwards compat that the proposal was never accepted but since it turns out that is not the issue, do you have any idea why the proposal was never accepted ?
- pjmlp 4y agoObjective-C and C++ never had any issues having additionaly types for arrays and strings, C could do the same, but WG14 has clearly decided they don't want to do that.
- cassepipe 4y agoYes, so why WG14 or whoever in charge has not accepted that one simple addition responsible for so many errors ? It's not like it would affect performance. For strings, it would even make it better, simply moving the lenght around with the compiler's help.
- pjmlp 4y agoMost likely as they have proven during the last 40 years, security is not in their agenda. Even the Annex K design was misguided, as it expected parameters to still be separate pointer + length arguments, thus hardly changing anything regarding getting them wrong.
- WalterBright 4y agoIt turns out that bounds checked arrays are ideal for strings. One no longer has to run strlen, which is inherently slow and cache-unfriendly. One can also slice a substring without needing to allocate and copy.