From f2297c20b69d942fd1e8fdcdd8f4d142c71de662 Mon Sep 17 00:00:00 2001 From: Matthew Sotoudeh Date: Sun, 30 Jul 2023 18:09:52 -0700 Subject: bad line numbers support --- main.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index db9f31c..36c16e9 100644 --- a/main.c +++ b/main.c @@ -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; } -- cgit v1.2.3