3 ms·
What does any of that have to do with whether or not you can EXPRESS bounds checking in a C program? You were misinformed; one can certainly express bounds che
by lelanthran 3y ago
What does any of that have to do with whether or not you can EXPRESS bounds checking in a C program?
You were misinformed; one can certainly express bounds checking in a C program, independent of libraries or compiler extensions.
- pjmlp 3y agoPlease educate us, we are all curious to learn how. Only the ISO C language is allowed, declare C array and then show us how do you validate the accesses with the index operator. As second exercise, show us how a function call using pointer + length, validates that the lengh into the pointer region is a valid length for the memory region total size.
- agumonkey 3y agoslightly branching out, I wonder if recent languages like zig allow (or will) customized array language features. They seem to more flexible about compiletime vs runtime and also allocation mechanisms
- lelanthran 3y ago> Only the ISO C language is allowed, declare C array and then show us how do you validate the accesses with the index operator. Who said anything about arrays? Let me refresh what was said, and what you claimed. What was said: > what do you think apl and oberon can express that C cannot ? What you claimed > Bounds checking by default. Are you seriously saying that you did not claim that bounds checking cannot be expressed in C? Because that is all this boils down to - my reading of that was that you claimed that bounds checking is an example of a thing that "apl and oberon can express that C cannot ? " > Only the ISO C language is allowed, declare C array and then show us how do you validate the accesses with the index operator. No one made this claim so there is no point in doing what you asked. > As second exercise, show us how a function call using pointer + length, validates that the lengh into the pointer region is a valid length for the memory region total size. No one claimed this either. The specific claim is that it is possible to express bounds checking in C.
- pjmlp 3y agoToo many words and very little facts. Care to provide your library for the security folks to have a go at your bounds checking implementation in C.
- lelanthran 3y ago> Care to provide your library for the security folks to have a go at your bounds checking implementation in C. Once again, I have to ask - what does that have to do with your claim that C is unable to express bounds checking?