Skip to content

Commit af265da

Browse files
committed
Don't repeat error 042 twice when a function is defined as static and its name starts with @
1 parent daad976 commit af265da

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

source/compiler/sc1.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -3991,7 +3991,8 @@ static int newfunc(char *firstname,int firsttag,int fpublic,int fstatic,int fsto
39913991
return TRUE; /* it was recognized as a function declaration, but not as a valid one */
39923992
funcusage=sym->usage; /* before setting flags `uDECLPUBLIC` and `uDECLSTATIC`,
39933993
* back up the current usage state, we'll need it later */
3994-
if ((fpublic && (sym->usage & uDECLSTATIC)!=0) || (fstatic && (sym->usage & uDECLPUBLIC)!=0))
3994+
if (symbolname[0]!=PUBLIC_CHAR && ((fpublic && (sym->usage & uDECLSTATIC)!=0)
3995+
|| (fstatic && (sym->usage & uDECLPUBLIC)!=0)))
39953996
error(42); /* invalid combination of class specifiers */
39963997
if (fpublic && opertok==0)
39973998
sym->usage |= (uPUBLIC | uDECLPUBLIC);

0 commit comments

Comments
 (0)