diff options
| author | 2023-06-04 23:26:06 +0200 | |
|---|---|---|
| committer | 2023-06-04 23:26:06 +0200 | |
| commit | 6ce2ac20e1d9095281a233aeb778d0fa2c82dd74 (patch) | |
| tree | e40a1b5f1c560ee48959cfea9ccaf816383223a5 /main.c | |
| parent | 44dff9c3b9f0ba5ab574c91f406855a1cf0f4e7b (diff) | |
better diagnostics
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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); |