[clang] [Sema] Warning for _Float16 passed to format specifier '%f' (PR #74439)

Haocong Lu via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 5 23:49:12 PST 2023


Luhaocong wrote:

> Should this only apply in C23 mode? Standard behavior until C23 is that `_Float16` promotes to `double`. What about C++?

It seems clang never support default argument promotions for _Float16, as described in https://github.com/llvm/llvm-project/blob/main/clang/docs/LanguageExtensions.rst#id68 five years ago. Is there any demand to support this in old C/C++ standard?

And I try case with -std=c99 (https://godbolt.org/z/xqx8e6oh5) and -std=c++11 (https://godbolt.org/z/Mrn779Tdq) , GCC give a warning at both.

https://github.com/llvm/llvm-project/pull/74439


More information about the cfe-commits mailing list