Stream: t-lang/wg-unsafe-code-guidelines

Topic: fp layout


gnzlbg (Mar 15 2019 at 11:43, on Zulip):

@rkruppe i've reworded the fp layout text

gnzlbg (Mar 15 2019 at 11:44, on Zulip):

in the PR ucg#98 it says that f32 and f64 have binary32 and binary64 layout of the IEEE-754 (without being more specific)

gnzlbg (Mar 15 2019 at 11:44, on Zulip):

it also says that iff __STDC_IEC_559__ is defined, then these types are safe to use in C FFI.

gnzlbg (Mar 15 2019 at 11:44, on Zulip):

if __STDC_IEC_559__ is not defined, then whether that's the case is _implementation-defined_

gnzlbg (Mar 15 2019 at 11:46, on Zulip):

so Rust doesn't end up tied to __STDC_IEC_559__

gnzlbg (Mar 15 2019 at 11:46, on Zulip):

OTOH we assume that the C implementation is up to a point standard compliant, so in the case of clang, which defines __STDC_IEC_559__ even though its not compliant, the above feels weird

rkruppe (Mar 15 2019 at 11:50, on Zulip):

I think the way it's worded now is probably the best we're going to get without revisiting the can of worms labeled "what to do about the fact that no C implementation is actually compliant but they all work with Rust anyway" which I have no interest in doing

rkruppe (Mar 15 2019 at 11:50, on Zulip):

It's such a mess

gnzlbg (Mar 15 2019 at 12:48, on Zulip):

i agree, I'll resolve the conversation in the PR

Last update: Nov 19 2019 at 17:50UTC