← Back to davo.co
summaryrefslogtreecommitdiffstats
path: root/sequence_point.c
diff options
context:
space:
mode:
authorDavid Faulkner <[email protected]>2026-08-07 23:40:47 -0500
committerDavid Faulkner <[email protected]>2026-08-07 23:40:47 -0500
commitb3e9e62599532050fc776c5e8f076915b56c2235 (patch)
treeaf252346106a61b18cc6fc6fdbd32e962d096f1c /sequence_point.c
Import official C23 code examples for Modern C (Jens Gustedt, 2024)HEADupstream-importmain
- Add official C source files, Makefile, c23-fallback.h, and LICENSE - Update README.md with study mirror notice
Diffstat (limited to 'sequence_point.c')
-rw-r--r--sequence_point.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sequence_point.c b/sequence_point.c
new file mode 100644
index 0000000..6048cb6
--- /dev/null
+++ b/sequence_point.c
@@ -0,0 +1,10 @@
+#include<stdio.h>
+
+unsigned add(unsigned* x, unsigned const* y) [[unsequenced]] {
+ return *x += *y;
+}
+int main(void) {
+ unsigned a = 3;
+ unsigned b = 5;
+ printf("a = %u, b = %u\n", add(&a, &b), add(&b, &a));
+}