From 1de8c94c50fb2a4b038952ee5a7076ee65aeea01 Mon Sep 17 00:00:00 2001 From: Martin Uecker Date: Mon, 30 Mar 2026 15:25:11 +0200 Subject: [PATCH 1/9] C2Y: Remove 'auto' placeholder type entry This feature is not voted in as of March 2026. Signed-off-by: Martin Uecker --- features_c2y.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/features_c2y.yaml b/features_c2y.yaml index ce9aa38..a4b9932 100644 --- a/features_c2y.yaml +++ b/features_c2y.yaml @@ -269,9 +269,6 @@ features: - GCC 16 - Xcode 16.4 - - desc: "`auto` as placeholder type for parameters" - paper: N3472 - - desc: "Slay Some Earthly Demons XIII" paper: N3478 support: From ad0b0731af760d6071146b68c74f3635d00bb433 Mon Sep 17 00:00:00 2001 From: Martin Uecker Date: Mon, 30 Mar 2026 14:15:52 +0200 Subject: [PATCH 2/9] C23: GCC supports empty initializers fully https://godbolt.org/z/c65f1shx1 Signed-off-by: Martin Uecker --- features_c23.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features_c23.yaml b/features_c23.yaml index 35222cb..ca105d4 100644 --- a/features_c23.yaml +++ b/features_c23.yaml @@ -210,12 +210,12 @@ features: paper: N2900 content: c-empty-init.md support: - - GCC 13 (partial) + - GCC 13 - Clang (partial) - Xcode (partial) hints: - target: GCC 13 - msg: "Supported as an extension. Missing support for scalars and variable-length arrays (VLAs)." + msg: "Partially supported as an extension before." - target: Clang msg: "Supported as an extension. Missing support for scalars and variable-length arrays (VLAs)." - target: Xcode From f5ac6dbd081ddb77d150c87f62582e47a64dc9c4 Mon Sep 17 00:00:00 2001 From: Martin Uecker Date: Tue, 31 Mar 2026 09:59:19 +0200 Subject: [PATCH 3/9] C2Y: GCC implements constraints related to definiton of main https://godbolt.org/z/W4xxdaaGq Signed-off-by: Martin Uecker --- features_c2y.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/features_c2y.yaml b/features_c2y.yaml index a4b9932..47c73c9 100644 --- a/features_c2y.yaml +++ b/features_c2y.yaml @@ -336,6 +336,7 @@ features: - desc: "Earthly Demon XV: Definition of Main" paper: N3623 support: + - GCC - Clang - Xcode ? From 3f0d3a8b312c3228793bec92bc1b3b4223ed0c5f Mon Sep 17 00:00:00 2001 From: Martin Uecker Date: Tue, 31 Mar 2026 11:06:07 +0200 Subject: [PATCH 4/9] C99: GCC supports VM types Signed-off-by: Martin Uecker --- features_c99.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/features_c99.yaml b/features_c99.yaml index 3eae9bf..ed8d37e 100644 --- a/features_c99.yaml +++ b/features_c99.yaml @@ -71,6 +71,7 @@ features: - desc: "Variably-modified (VM) types" paper: N2778 support: + - GCC - Clang - Xcode - desc: "Designated initializers" From c354f3b0d6c8cf7286b718257e3fa40013ed3d24 Mon Sep 17 00:00:00 2001 From: Martin Uecker Date: Tue, 31 Mar 2026 10:53:14 +0200 Subject: [PATCH 5/9] C2Y: member access clarification Every compiler does this anyway https://godbolt.org/z/o1zqcrddG Signed-off-by: Martin Uecker --- features_c2y.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/features_c2y.yaml b/features_c2y.yaml index 47c73c9..b2d6eb1 100644 --- a/features_c2y.yaml +++ b/features_c2y.yaml @@ -310,8 +310,10 @@ features: - desc: "Member access of an incomplete object" paper: N3532 support: + - GCC + - MSVC - Clang - - Xcode 16.4 + - Xcode - desc: "Chasing Ghosts I: constant expressions" paper: N3558 From f0fdcfee7a135110dcb62257bd941e15430bb02e Mon Sep 17 00:00:00 2001 From: Martin Uecker Date: Tue, 31 Mar 2026 13:47:43 +0200 Subject: [PATCH 6/9] C: variably modified types fixes --- features_c23.yaml | 7 +++++++ features_c99.yaml | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/features_c23.yaml b/features_c23.yaml index ca105d4..9508e6b 100644 --- a/features_c23.yaml +++ b/features_c23.yaml @@ -186,6 +186,13 @@ features: - GCC 14 - Clang 15 - Xcode 16.1 + - desc: "Require support for variably modified types" + paper: N2778 + support: + - GCC + - Clang + - Xcode + - TinyCC 0.9.28 - desc: "`__has_include` in preprocessor conditionals" paper: N2799 support: diff --git a/features_c99.yaml b/features_c99.yaml index ed8d37e..31ab2aa 100644 --- a/features_c99.yaml +++ b/features_c99.yaml @@ -68,12 +68,13 @@ features: - Clang - Xcode 14 - TinyCC - - desc: "Variably-modified (VM) types" - paper: N2778 + - desc: "[Variably-modified](https://en.cppreference.com/w/c/language/array.html#Variable-length_arrays) (VM) types" + paper: N683 support: - GCC - Clang - Xcode + - TinyCC 0.9.28 - desc: "Designated initializers" paper: N494 content: c-designated-init.md From 98a17d9d9a0c775ad347f1af253cfe9aa7b472be Mon Sep 17 00:00:00 2001 From: Martin Uecker Date: Tue, 31 Mar 2026 14:02:50 +0200 Subject: [PATCH 7/9] C: split-off content for vm types VLA and VM types are related, but if we have separate feature entries, the example should be split up as well. --- content/c-vla.md | 12 ------------ content/c-vm-types.md | 36 ++++++++++++++++++++++++++++++++++++ features_c99.yaml | 1 + 3 files changed, 37 insertions(+), 12 deletions(-) create mode 100644 content/c-vm-types.md diff --git a/content/c-vla.md b/content/c-vla.md index 9640cf2..9b140c9 100644 --- a/content/c-vla.md +++ b/content/c-vla.md @@ -21,15 +21,6 @@ only at runtime, useful for algorithms where the size depends on function parame ```c #include -void print_matrix(int rows, int cols, int matrix[rows][cols]) { - for (int i = 0; i < rows; i++) { - for (int j = 0; j < cols; j++) { - printf("%3d ", matrix[i][j]); - } - printf("\n"); - } -} - int main(void) { int n = 3; int arr[n]; // VLA with runtime size @@ -41,8 +32,5 @@ int main(void) { for (int i = 0; i < n; i++) printf("%d ", arr[i]); printf("\n"); - - int matrix[2][3] = {{1, 2, 3}, {4, 5, 6}}; - print_matrix(2, 3, matrix); } ``` diff --git a/content/c-vm-types.md b/content/c-vm-types.md new file mode 100644 index 0000000..2c806f2 --- /dev/null +++ b/content/c-vm-types.md @@ -0,0 +1,36 @@ +--- +execute: true +show_assembly: true +flags: "-std=c99" +--- + +## What It Does + +Variably-modified types are types of variable-length arrays or types derived from VLAs, +e.g. pointers to VLAs or multi-dimensional arrays types where some dimension is variable. + +## Why It Matters + +Variably-modified types encode the number of elements of arrays in their type. This +allows convenient indexing into multi-dimenional arrays, recovery of the number of +elements from the type, and enables improved static analysis and automatic bounds checking. + +## Example + +```c +#include + +void print_matrix(int rows, int cols, int matrix[rows][cols]) { + for (int i = 0; i < rows; i++) { + for (int j = 0; j < cols; j++) { + printf("%3d ", matrix[i][j]); + } + printf("\n"); + } +} + +int main(void) { + int matrix[2][3] = {{1, 2, 3}, {4, 5, 6}}; + print_matrix(2, 3, matrix); +} +``` diff --git a/features_c99.yaml b/features_c99.yaml index 31ab2aa..2d531ef 100644 --- a/features_c99.yaml +++ b/features_c99.yaml @@ -70,6 +70,7 @@ features: - TinyCC - desc: "[Variably-modified](https://en.cppreference.com/w/c/language/array.html#Variable-length_arrays) (VM) types" paper: N683 + content: c-vm-types.md support: - GCC - Clang From c55931c37639d9715ef66600a63daff1b522434e Mon Sep 17 00:00:00 2001 From: Martin Uecker Date: Tue, 31 Mar 2026 14:16:51 +0200 Subject: [PATCH 8/9] C23: labels for clang --- features_c23.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/features_c23.yaml b/features_c23.yaml index 9508e6b..d9a8368 100644 --- a/features_c23.yaml +++ b/features_c23.yaml @@ -73,9 +73,13 @@ features: paper: N2508 support: - GCC 11 - - Clang 16 + - Clang 16 (partial) + - Clang 18 - MSVC (partial) - Xcode 15 + hints: + - target: Clang 16 + msg: "Only labels at the end of a block are supported" - desc: "[Binary integer constants](https://en.cppreference.com/w/c/language/integer_constant.html)" paper: N2549 content: c-binary-literals.md From d9b0bdb3f4f69088a4566d079bc79eca8a0e81df Mon Sep 17 00:00:00 2001 From: Martin Uecker Date: Tue, 31 Mar 2026 14:32:47 +0200 Subject: [PATCH 9/9] C23: add partial program correctness --- features_c23.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/features_c23.yaml b/features_c23.yaml index d9a8368..bf7ad87 100644 --- a/features_c23.yaml +++ b/features_c23.yaml @@ -337,3 +337,10 @@ features: - GCC 13 - Clang 16 (partial) - Xcode 16.1 + - desc: "Partial program correctness" + paper: N3128 + support: + - GCC (partial) + hints: + - target: GCC + msg: "Not guaranteed for volatile accesses"