[clang] [Clang] add support for C23 'H', 'D', and 'DD' length modifiers (PR #201098)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 5 06:20:15 PDT 2026
================
@@ -0,0 +1,57 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -std=c23 -fsyntax-only -verify -Wformat %s
+
+int printf(const char *restrict, ...);
+int scanf(const char *restrict, ...);
+
+void t1(float f, double d, long double ld) {
+ printf("%Hf", f);
----------------
AaronBallman wrote:
I think this PR might be a bit challenging given that we don't support decimal floating point types in Clang yet. So, for example, all of these are wrong to silently accept because the types are incorrect: https://godbolt.org/z/r7MTdcecE
Perhaps the way forward is to recognize the specifiers but always diagnose on their use because there are currently no types which would match in our implementation?
CC @michaelrj-google
https://github.com/llvm/llvm-project/pull/201098
More information about the cfe-commits
mailing list