aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-09-03 20:40:18 +0900
committernsfisis <nsfisis@gmail.com>2025-09-03 20:40:18 +0900
commit1d7cd873dff0ee54aa41434c8b001a5cd467dc3c (patch)
tree88c0a73206b5b81731e86d668ecb3ed2f7b6df16 /src
parent980d73ce25b116e645b16e9ed37dcf55fdffad7a (diff)
downloadducc-1d7cd873dff0ee54aa41434c8b001a5cd467dc3c.tar.gz
ducc-1d7cd873dff0ee54aa41434c8b001a5cd467dc3c.tar.zst
ducc-1d7cd873dff0ee54aa41434c8b001a5cd467dc3c.zip
feat: add --std=c23
Diffstat (limited to 'src')
-rw-r--r--src/cli.c2
-rw-r--r--src/common.h4
-rw-r--r--src/std.h2
3 files changed, 7 insertions, 1 deletions
diff --git a/src/cli.c b/src/cli.c
index bd0d915..c5649f0 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -39,6 +39,8 @@ CliArgs* parse_cli_args(int argc, char** argv) {
} else if (strcmp(argv[i], "--version") == 0) {
print_version();
exit(0);
+ } else if (strcmp(argv[i], "--std=c23") == 0) {
+ // ignore --std=c23
} else {
fatal_error("unknown option: %s", argv[i]);
}
diff --git a/src/common.h b/src/common.h
index 4bd4c17..332b61d 100644
--- a/src/common.h
+++ b/src/common.h
@@ -5,7 +5,11 @@
_Noreturn void fatal_error(const char* msg, ...);
+// TODO
+#ifdef __ducc__
#define unreachable() fatal_error("%s:%d: unreachable", __FILE__, __LINE__)
+#endif
+
#define unimplemented() fatal_error("%s:%d: unimplemented", __FILE__, __LINE__)
bool str_ends_with(const char* s, const char* suffix);
diff --git a/src/std.h b/src/std.h
index d584e1a..c2d7b26 100644
--- a/src/std.h
+++ b/src/std.h
@@ -16,7 +16,7 @@ int fclose(FILE*);
int fprintf(FILE*, const char*, ...);
char* fgets(char*, int, FILE*);
FILE* fopen(const char*, const char*);
-int getchar(void);
+int getchar();
int isalnum(int);
int isalpha(int);
int isdigit(int);