|
|
|
|
|
by klodolph
1829 days ago
|
|
> Who mentioned anything about breaking existing code? You did, when you proposed writing &array[0] to get the address to the first element of an array. Or maybe I misunderstand what you wrote, in which case you could clarify. > Unfortunely I have to use software written by people that don't share that opinion and apparently WG14 also has a general policy that improving C safety doesn't matter. What would WG14 be doing differently if they didn’t have this “policy”? Isn’t the obvious explanation that their top priority is to maintain compatibility with existing code? Is this explanation not satisfactory? It seems absurd—in the extreme—to expect a standards committee to break large swaths existing code to improve safety, in a language with such a large amount of legacy code such as C. I would expect that if the standards committee chose to do that, compilers wouldn’t implement it and users wouldn’t use it. If you are going to break existing code, why not use a different language? |
|
That would only happen in two cases:
1 - If C arrays had been properly designed in first place,
2 - Since it is too late for 1 unless we happen to have a DeLorean parked around the corner, by introducing a new datatype for new code, just like happened to bool and complex on C99.
This is basic compiler design stuff that surely the WG14 heads are capable of.
If not, the Microsoft team from Checked C project can gladly explain to them how to extend C with new array types, while keeping compatibility with existing code.
I really don't get your "maintain compatibility with existing code" hot discussion.