Re:Imposing memory security in C [video]
by layer8 on Thursday February 27, 2025 @05:54PM
(#43199480)
Does Fil-C support uintptr_t? Because I’ve written programs that I believe to be quite strictly conforming C99 programs, that make use of uintptr_t.
[ Parent
| on HN ]
Re:Imposing memory security in C [video]
by pizlonator on Thursday February 27, 2025 @06:15PM
(#43199655)
Yes you can use uintptr_t.
You just can’t cast a pointer to uintptr_t, then store that int into memory, then load it back, then cast it back to pointer, and then dereference that pointer.
Re:Imposing memory security in C [video]
by layer8 on Thursday February 27, 2025 @06:30PM
(#43199767)
Okay, but the C standard does allow exactly that for void*.
Re:Imposing memory security in C [video]
by pizlonator on Thursday February 27, 2025 @06:53PM
(#43199976)
You can do exactly that with `void*` in Fil-C.
I just don’t let integer types carry capabilities. If I did, things would get weird (like if you said `x + y` and both happened to carry capabilities then what would you get?)