3 ms·
I've repeated the part about implementation-dependent behavior here twice and it seems like you've ignored it both times, which is frustrating. I understand CH
by klodolph 4y ago
I've repeated the part about implementation-dependent behavior here twice and it seems like you've ignored it both times, which is frustrating.
I understand CHERI. What I don't understand is why you are assuming that the implementation MUST be CHERI, and that non-CHERI implementations are somehow not included in the discussion.
> NaN boxing literally requires floating point types, and nothing in the standard permits floating point types to be used this way.
Nothing in the standard requires intptr_t to exist, or floating-point types to be IEEE 754, etc. You'd have to be completely deranged to try and think that this is portable C.
The pointers are, again, NOT being interpreted as floating-point numbers. The are, instead, being converted into integers and put into unions, and then taken back out as integers. The "NaN boxing" part is just a way to do this so that when you stick a float into the same union, it will occupy a different space of integers.
Which OBVIOUSLY relies on implementation-defined behavior, and certain assumptions about the platform you're working on--so I do not understand the motivation for the discussion here.