Skip to content

Fix return array size specifications being ignored in operator declarations #686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions source/compiler/sc1.c
Original file line number Diff line number Diff line change
Expand Up @@ -3822,8 +3822,10 @@ static void funcstub(int fnative)
} /* if */

if (tok==tOPERATOR) {
if (numdim!=0)
if (numdim!=0) {
error(10); /* invalid function or declaration */
numdim=0; /* ignore the array size specification */
} /* if */
opertok=operatorname(symbolname);
if (opertok==0)
return; /* error message already given */
Expand Down Expand Up @@ -3923,7 +3925,7 @@ static void funcstub(int fnative)
if (numdim!=sym->child->dim.array.level+1) {
error(25); /* function heading differs from prototype */
} else {
unsigned int i=0;
int i=0;
sub=sym->child;
do {
if (dim[i]!=sub->dim.array.length) {
Expand Down