Skip to content

Commit

Permalink
Prevent compiler warnings related to abnormal exit and fallthrough.
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-s-raymond committed Jul 8, 2023
1 parent 69fc0f7 commit 04cb065
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions LOG
Original file line number Diff line number Diff line change
Expand Up @@ -2373,3 +2373,5 @@
- fix repair to invalid live-pointer mask, where a pass did not handle the
new raw-data form correctly
mats/fx.ms s/cpnanopass.ss
- avoid sime trivial warnings related to abnormal exit and fallthrough.
c/scheme.c c/schsig.c
10 changes: 5 additions & 5 deletions c/scheme.c
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ extern void Sscheme_init(void (*abnormal_exit)(void)) {
case BOOTING:
fprintf(stderr, "error (Sscheme_init): already initialized\n");
S_abnormal_exit();
break;
break; /* Pacify compilers treating fallthrough warnings as errors */
case UNINITIALIZED:
case DEINITIALIZED:
break;
Expand Down Expand Up @@ -1075,7 +1075,7 @@ extern void Sbuild_heap(const char *kernel, void (*custom_init)(void)) {
case RUNNING:
fprintf(stderr, "error (Sbuild_heap): already running\n");
S_abnormal_exit();
break;
break; /* Pacify compilers treating fallthrough warnings as errors */
case BOOTING:
break;
}
Expand Down Expand Up @@ -1183,7 +1183,7 @@ extern INT Sscheme_start(INT argc, const char *argv[]) {
case BOOTING:
fprintf(stderr, "error (Sscheme_start): no heap built yet; call Sbuild_heap first\n");
S_abnormal_exit();
break;
break; /* Pacify compilers treating fallthrough warnings as errors */
case RUNNING:
break;
}
Expand Down Expand Up @@ -1219,7 +1219,7 @@ static INT run_script(const char *who, const char *scriptfile, INT argc, const c
case BOOTING:
fprintf(stderr, "error (%s): no heap built yet; call Sbuild_heap first\n", who);
S_abnormal_exit();
break;
break; /* Pacify compilers treating fallthrough warnings as errors */
case RUNNING:
break;
}
Expand Down Expand Up @@ -1269,7 +1269,7 @@ extern void Sscheme_deinit(void) {
case BOOTING:
fprintf(stderr, "error (Sscheme_deinit): not yet running\n");
S_abnormal_exit();
break;
break; /* Pacify compilers treating fallthrough warnings as errors */
case RUNNING:
break;
}
Expand Down
4 changes: 2 additions & 2 deletions c/schsig.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,11 +673,11 @@ static void handle_signal(INT sig, UNUSED siginfo_t *si, UNUSED void *data) {
case SIGILL:
RESET_SIGNAL
S_error_reset("illegal instruction");
break;
break; /* Pacify compilers treating fallthrough warnings as errors */
case SIGFPE:
RESET_SIGNAL
S_error_reset("arithmetic overflow");
break;
break; /* Pacify compilers treating fallthrough warnings as errors */
#ifdef SIGBUS
case SIGBUS:
#endif /* SIGBUS */
Expand Down

0 comments on commit 04cb065

Please sign in to comment.