Since version 6, clang has supported a __fp16
type. I would like to use it, but I need to support other compilers (both clang-based and non-clang-based) as well as older versions of clang, so I need a reliable way to detect support. Unfortunately, I don't see anything in clang's documentation about how to detect it (using __has_feature
, __has_extension
, etc.).
Since clang's version number macros are unreliable, the best solution I have right now is to use __has_warning("-Wpragma-pack")
(the -Wpragma-pack warning was also added in clang 6). I'm hoping that there is a fp16 feature/extension/whatever I can check instead which just isn't documented where I'm looking, but obviously open to other ideas.
So, does anyone know of a better way to detect __fp16
support?