|
|
|
|
|
by thradams
856 days ago
|
|
>Can you ask Github Co-pilot to look at C code and answer the question "What is >the length of the array 'buf' passed to this function"? That tells you how to >express the array in a language where arrays have enforced lengths, whicn >includes both C++ and Rust this is the way you tell C what is the size of array. void f(int n, int a[n]) {
}
|
|
Over a decade ago, I proposed that sizes in parameters should be checkable and readable I worked out how to make it work.[1] But I didn't have time for the politics of C standards.
[1] http://animats.com/papers/languages/safearraysforc43.pdf