(Replying to PARENT post)

Incremental improvement is a hard constraint here.

Keeping track of pointer and length in two separate variables, when the C program has a freedom to do whatever it wants with them, creates a lot of hassle and edge cases to deal with. If C had a concept of a slice/array view that manages ptr+length as a single entity, it'd be so much easier.

๐Ÿ‘คpornel๐Ÿ•‘6y๐Ÿ”ผ0๐Ÿ—จ๏ธ0

(Replying to PARENT post)

For cases where the platform supports C++ (and its standard library), there is kind of a corresponding "checked C++"[1] that also supports the "completely incremental" migration approach. (And obviously supports "array view" type objects.)

[1] shameless plug: https://github.com/duneroadrunner/SaferCPlusPlus#safercplusp...

๐Ÿ‘คduneroadrunner๐Ÿ•‘6y๐Ÿ”ผ0๐Ÿ—จ๏ธ0