Skip to content

Commit 55164b8

Browse files
committed
fixed: warnings preventing compilation
1 parent 7f1d01b commit 55164b8

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

compiler/cli/error_printing.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,3 +194,14 @@ void onyx_errors_print(onyx_context_t *ctx, char *error_format, b32 colored_prin
194194
if (error_format_json) bh_printf("]");
195195
}
196196

197+
b32 onyx_errors_present(onyx_context_t *ctx) {
198+
fori (i, 0, onyx_error_count(ctx)) {
199+
onyx_error_details_t err;
200+
if (onyx_error_rank(ctx, i) >= ONYX_ERROR_WAITING) {
201+
return 1;
202+
}
203+
}
204+
205+
return 0;
206+
}
207+

compiler/cli/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -945,8 +945,8 @@ int main(int argc, char *argv[]) {
945945

946946
u64 duration = bh_time_duration(start_time);
947947

948-
if (onyx_error_count(ctx) > 0) {
949-
onyx_errors_print(ctx, cli_args.error_format, !cli_args.no_colors, cli_args.show_all_errors);
948+
onyx_errors_print(ctx, cli_args.error_format, !cli_args.no_colors, cli_args.show_all_errors);
949+
if (onyx_errors_present(ctx)) {
950950
return 1;
951951
}
952952

0 commit comments

Comments
 (0)