mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 05:36:07 +00:00

This paper makes it a constraint violation (instead of UB) to call va_start from a function with a fixed (non-variadic) parameter list. This is something Clang has always diagnosed as an error.
16 lines
417 B
C
16 lines
417 B
C
// RUN: %clang_cc1 -verify -std=c2y -Wall -pedantic -ffreestanding %s
|
|
|
|
/* WG14 N3482: Yes
|
|
* Slay Some Earthly Demons XVII
|
|
*
|
|
* This paper makes it a constraint violation to call va_start in a non-
|
|
* variadic function. This is something Clang has always diagnosed.
|
|
*/
|
|
|
|
#include <stdarg.h>
|
|
|
|
void func(int a) {
|
|
va_list list;
|
|
va_start(list, a); // expected-error {{'va_start' used in function with fixed args}}
|
|
}
|