Skip to content

Commit 73d102b

Browse files
committed
Add a distinct error for division by zero
1 parent 29770ae commit 73d102b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

source/compiler/sc3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ static cell flooreddiv(cell a,cell b,int return_remainder)
644644
cell q,r;
645645

646646
if (b==0) {
647-
error(29);
647+
error(94); /* division by zero */
648648
return 0;
649649
} /* if */
650650
/* first implement truncated division in a portable way */

source/compiler/sc5.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ static char *errmsg[] = {
132132
/*090*/ "public functions may not return arrays (symbol \"%s\")\n",
133133
/*091*/ "ambiguous constant; tag override is required (symbol \"%s\")\n",
134134
/*092*/ "functions may not return arrays of unknown size (symbol \"%s\")\n",
135-
/*093*/ "\"__addressof\" operator is invalid in preprocessor expressions\n"
135+
/*093*/ "\"__addressof\" operator is invalid in preprocessor expressions\n",
136+
/*094*/ "division by zero\n"
136137
};
137138

138139
static char *fatalmsg[] = {

0 commit comments

Comments
 (0)