by c99throwa1 · 11y ago · 0 comments
The paper claims the implementation obeys C99, but there seems to be a violation around pointer round-tripping. Specifically, they forbid all casts from integers to pointers.
char a, *p;
p = (char*)(uintptr_t)&a;
In most C implementations, this is perfectly valid. In the paper's, it breaks.Anyway, very interesting.
I believe this violates C99 §7.18.1.4 (if the TruffleC language defines the uintptr_t type in stdint.h):
The following type designates an unsigned integer type
with the property that any valid pointer to void can be
converted to this type, then converted back to pointer to
void, and the result will compare equal to the original
pointer:
uintptr_t
If the TruffleC language does not define uintptr_t ("these types are optional"), then hey, that's fine. A lot of valid code won't compile, though.