Skip to content

Commit 483b99d

Browse files
authored
Clean up (#206)
Adds error report when encountered unrecognized option argument and fix error diagnostic message when type of variable declaration is not found.
1 parent ad445a7 commit 483b99d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ int main(int argc, char *argv[])
6262
} else
6363
/* unsupported options */
6464
abort();
65+
} else if (argv[i][0] == '-') {
66+
fatal("Unidentified option");
6567
} else
6668
in = argv[i];
6769
}

src/parser.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -709,8 +709,8 @@ void read_full_var_decl(var_t *vd, int anon, int is_param)
709709
type_t *type = find_type(type_name, find_type_flag);
710710

711711
if (!type) {
712-
printf("Could find type %s%s\n", find_type_flag == 2 ? "struct " : "",
713-
type_name);
712+
printf("Could not find type %s%s\n",
713+
find_type_flag == 2 ? "struct " : "", type_name);
714714
abort();
715715
}
716716

0 commit comments

Comments
 (0)