3 ms·
The problem is that this would have one specific ABI, which probably wouldn't match many existing structs with a flexible array member at the end. Could potenti
by planede 4y ago
The problem is that this would have one specific ABI, which probably wouldn't match many existing structs with a flexible array member at the end. Could potentially be used for new code (while requiring every user to upgrade the standard they compile with), but has the risk of not usable for modernizing old code.
- WalterBright 4y agoYou're right that bounds checked arrays do nothing at all for existing code. But they can be added incrementally to an existing code base, as a normal part of working on the code. In that aspect it's like when prototypes were added to C. Nothing changed for existing code, but prototypes are so advantageous people would retrofit existing code incrementally when doing routine maintenance.
- planede 4y agoI presume prototypes could be added to transform much of existing code without compatibility problems (ABI nor API), which is a clear advantage compared to checked arrays. Checked arrays might worth it regardless, but it's not applicable in most of the article's use cases.
- WalterBright 4y ago> Checked arrays might worth it regardless I can attest that they are. > it's not applicable in most of the article's use cases I don't believe that.