[clang] [C23] Add __builtin_c23_va_start (PR #131166)

via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 13 13:23:48 PDT 2025


================
@@ -6,27 +6,20 @@
 
 #include <stdarg.h>
 
-#define DERP this is an error
-
 void func(...) { // expected-warning {{'...' as the only parameter of a function is incompatible with C standards before C23}}
   // Show that va_start doesn't require the second argument in C23 mode.
   va_list list;
-  va_start(list); // expected-warning {{passing no argument for the '...' parameter of a variadic macro is incompatible with C standards before C23}} expected-note@* {{macro 'va_start' defined here}}
-  va_end(list);
-
-  // Show that va_start doesn't expand or evaluate the second argument.
-  va_start(list, DERP);
+  va_start(list);
----------------
Sirraide wrote:

>From what I recall the builtin is only available in C23 mode or later, so I’m not sure we need to worry about compat warnings—or am I misunderstanding the scenario here?

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


More information about the cfe-commits mailing list