Skip to content

Commit 5af5fb0

Browse files
committed
[C2y] Claim conformance to WG14 N3482
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.
1 parent d8dfdaf commit 5af5fb0

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

clang/test/C/C2y/n3482.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// RUN: %clang_cc1 -verify -std=c2y -Wall -pedantic -ffreestanding %s
2+
3+
/* WG14 N3482: Yes
4+
* Slay Some Earthly Demons XVII
5+
*
6+
* This paper makes it a constraint violation to call va_start in a non-
7+
* variadic function. This is something Clang has always diagnosed.
8+
*/
9+
10+
#include <stdarg.h>
11+
12+
void func(int a) {
13+
va_list list;
14+
va_start(list, a); // expected-error {{'va_start' used in function with fixed args}}
15+
}

clang/www/c_status.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ <h2 id="c2y">C2y implementation status</h2>
308308
<tr>
309309
<td>Slay Some Earthly Demons XVII</td>
310310
<td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3482.pdf">N3482</a></td>
311-
<td class="unknown" align="center">Unknown</td>
311+
<td class="full" align="center">Yes</td>
312312
</tr>
313313
<tr>
314314
<td>Clarify the specification of the width macros</td>

0 commit comments

Comments
 (0)