← Back to davo.co
summaryrefslogtreecommitdiffstats
path: root/bad.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 /bad.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 'bad.c')
-rw-r--r--bad.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/bad.c b/bad.c
new file mode 100644
index 0000000..7253662
--- /dev/null
+++ b/bad.c
@@ -0,0 +1,23 @@
+/* This may look like nonsense, but really is -*- mode: C -*- */
+
+/* The main thing that this program does. */
+void main() {
+ // Declarations
+ int i;
+ double A[5] = {
+ 9.0,
+ 2.9,
+ 3.E+25,
+ .00007,
+ };
+
+ // Doing some work
+ for (i = 0; i < 5; ++i) {
+ printf("element %d is %g, \tits square is %g\n", /*@\label{printf-start-badly}*/
+ i,
+ A[i],
+ A[i]*A[i]); /*@\label{printf-end-badly}*/
+ }
+
+ return 0; /*@\label{main-return-badly}*/
+}