[all-commits] [llvm/llvm-project] d781ac: [C23] Add __builtin_c23_va_start (#131166)

Aaron Ballman via All-commits all-commits at lists.llvm.org
Sat Mar 15 08:02:16 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d781ac1cf0d561b79f6ff834d786c6a999429901
      https://github.com/llvm/llvm-project/commit/d781ac1cf0d561b79f6ff834d786c6a999429901
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2025-03-15 (Sat, 15 Mar 2025)

  Changed paths:
    M clang/docs/LanguageExtensions.rst
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/Builtins.h
    M clang/include/clang/Basic/Builtins.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Basic/Builtins.cpp
    M clang/lib/CodeGen/CGBuiltin.cpp
    M clang/lib/Headers/__stdarg_va_arg.h
    M clang/lib/Sema/SemaChecking.cpp
    M clang/test/C/C23/n2975.c
    M clang/test/CodeGen/varargs.c
    A clang/test/Sema/c23-varargs.c

  Log Message:
  -----------
  [C23] Add __builtin_c23_va_start (#131166)

This builtin is supported by GCC and is a way to improve diagnostic
behavior for va_start in C23 mode. C23 no longer requires a second
argument to the va_start macro in support of variadic functions with no
leading parameters. However, we still want to diagnose passing more than
two arguments, or diagnose when passing something other than the last
parameter in the variadic function.

This also updates the freestanding <stdarg.h> header to use the new
builtin, same as how GCC works.

Fixes #124031



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list