This adds the _Float16 preprocessor macro definitions.
Details
Diff Detail
Event Timeline
lib/Headers/float.h | ||
---|---|---|
137 | My understanding is that, given that we support TS18661-2 by default, this macro should be predefined by clang and then there is no need to protect these macros. You may want to add a test for this in test/Preprocessor/init.c. | |
139–142 | There is a typo here, these macros should start with __FLT16_. Add a test for these names test/Headers/float.c. |
lib/Headers/float.h | ||
---|---|---|
137 | Where do you see that the __STDC_WANT_IEC_60559_TYPES_EXT__ macro should be predefined by clang? |
lib/Headers/float.h | ||
---|---|---|
137 | Hi Steve, certainly you're right, the TS says
so (if I read this right) these identifiers are only available if such macro is defined when including float.h. Can I assume from your comment that someone else should define it? Perhaps the float.h header itself, some other file in the C-library implementation or the user of the compiler via some -D__STDC_WANT_IEC_60559_TYPES_EXT__, but not be predefined by the compiler? If this is the case, then the macros still have to be guarded conditionally (as they were in the original patch). Does this make sense? Thanks. |
lib/Headers/float.h | ||
---|---|---|
137 | I think we could justify defining it ourselves under non-strict compilation modes; alternatively, system headers might define it for users in non-strict modes. My reading of the TS is that in strict mode, these types and macros should be hidden unless the user explicitly requests them by defining __STDC_WANT_IEC_60559_TYPES_EXT__ themselves. |
lib/Headers/float.h | ||
---|---|---|
137 | Thanks, very useful discussion and clarification. I will add some tests for this, which I indeed forgot. Cheers. |
My understanding is that, given that we support TS18661-2 by default, this macro should be predefined by clang and then there is no need to protect these macros.
You may want to add a test for this in test/Preprocessor/init.c.