diff options
author | Matthew Sotoudeh <matthew@masot.net> | 2023-07-30 18:09:52 -0700 |
---|---|---|
committer | Matthew Sotoudeh <matthew@masot.net> | 2023-07-30 18:09:52 -0700 |
commit | f2297c20b69d942fd1e8fdcdd8f4d142c71de662 (patch) | |
tree | 5072f8f11eea2d8265e48d6c3bce533e124f016f /main.c | |
parent | c84bbdc2a296f4b818fa8ec05a6dbe2dd46fc4f1 (diff) |
bad line numbers support
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -9,6 +9,7 @@ char *base_file; StringArray include_paths; bool opt_fcommon = false; bool opt_fpic; +bool opt_line_numbers; static FILE *open_file(char *path) { if (!path || strcmp(path, "-") == 0) @@ -64,8 +65,14 @@ static void cc1(char *base_file) { } int main(int argc, char **argv) { - assert(argc == 2); - base_file = argv[1]; - cc1(argv[1]); + for (int i = 1; i < argc; i++) { + if (!strcmp(argv[i], "--line-numbers")) { + opt_line_numbers = 1; + } else { + assert(!base_file); + base_file = argv[1]; + } + } + cc1(base_file); return 0; } |