Skip to content

Commit

Permalink
fixed: warnings preventing compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanfh committed Dec 31, 2024
1 parent 7f1d01b commit 55164b8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions compiler/cli/error_printing.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,14 @@ void onyx_errors_print(onyx_context_t *ctx, char *error_format, b32 colored_prin
if (error_format_json) bh_printf("]");
}

b32 onyx_errors_present(onyx_context_t *ctx) {
fori (i, 0, onyx_error_count(ctx)) {
onyx_error_details_t err;
if (onyx_error_rank(ctx, i) >= ONYX_ERROR_WAITING) {
return 1;
}
}

return 0;
}

4 changes: 2 additions & 2 deletions compiler/cli/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -945,8 +945,8 @@ int main(int argc, char *argv[]) {

u64 duration = bh_time_duration(start_time);

if (onyx_error_count(ctx) > 0) {
onyx_errors_print(ctx, cli_args.error_format, !cli_args.no_colors, cli_args.show_all_errors);
onyx_errors_print(ctx, cli_args.error_format, !cli_args.no_colors, cli_args.show_all_errors);
if (onyx_errors_present(ctx)) {
return 1;
}

Expand Down

0 comments on commit 55164b8

Please sign in to comment.