aboutsummaryrefslogtreecommitdiffhomepage
path: root/main.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2023-06-04 23:26:06 +0200
committerlemon <lsof@mailbox.org>2023-06-04 23:26:06 +0200
commit6ce2ac20e1d9095281a233aeb778d0fa2c82dd74 (patch)
treee40a1b5f1c560ee48959cfea9ccaf816383223a5 /main.c
parent44dff9c3b9f0ba5ab574c91f406855a1cf0f4e7b (diff)
better diagnostics
Diffstat (limited to 'main.c')
-rw-r--r--main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.c b/main.c
index 2404fd5..d56cd50 100644
--- a/main.c
+++ b/main.c
@@ -33,12 +33,14 @@ optparse(const char **file, const char **targ, char **args)
continue;
}
if ((x = optval(arg, "std"))) {
- if (!strcmp(x, "c89")) ccopt.cstd = STDC89;
+ if (!strcmp(x, "c89") || !strcmp(x, "c90")) ccopt.cstd = STDC89;
else if (!strcmp(x, "c99")) ccopt.cstd = STDC99;
else if (!strcmp(x, "c11")) ccopt.cstd = STDC11;
else if (!strcmp(x, "c2x")) ccopt.cstd = STDC23;
else if (!strcmp(x, "c23")) ccopt.cstd = STDC23;
else goto Bad;
+ } else if (!strcmp(arg, "pedantic")) {
+ ccopt.pedant = 1;
} else Bad: warn(NULL, "invalid option: %'s", arg-1);
}
}
@@ -61,6 +63,7 @@ main(int argc, char **argv)
atexit(flushstd);
detectcolor();
+ ccopt.cstd = STDC99; /* C99 by default */
optparse(&file, &targ, argv);
if (!file) {
efmt("usage: %s [options] <file>\n", *argv);