Skip to content

Commit 4f82dc9

Browse files
committed
Merge branch 'Branch_e74b8bb2' into dev
2 parents a455d47 + 5bce870 commit 4f82dc9

File tree

5 files changed

+31
-4
lines changed

5 files changed

+31
-4
lines changed

source/compiler/sc1.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5370,9 +5370,10 @@ static void destructsymbols(symbol *root,int level)
53705370
if ((opsym=findglb(symbolname,sGLOBAL))!=NULL) {
53715371
if ((opsym->usage & uMISSING)!=0 || (opsym->usage & uPROTOTYPED)==0) {
53725372
char symname[2*sNAMEMAX+16]; /* allow space for user defined operators */
5373+
char *ptr= (sym->documentation!=NULL) ? sym->documentation : "";
53735374
funcdisplayname(symname,opsym->name);
53745375
if ((opsym->usage & uMISSING)!=0)
5375-
error(4,symname); /* function not defined */
5376+
error(4,symname,ptr); /* function not defined */
53765377
if ((opsym->usage & uPROTOTYPED)==0)
53775378
error(71,symname); /* operator must be declared before use */
53785379
} /* if */

source/compiler/sc3.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,10 @@ static void (*unopers[])(void) = { lneg, neg, user_inc, user_dec };
200200
/* check existence and the proper declaration of this function */
201201
if ((sym->usage & uMISSING)!=0 || (sym->usage & uPROTOTYPED)==0) {
202202
char symname[2*sNAMEMAX+16]; /* allow space for user defined operators */
203+
char *ptr= (sym->documentation!=NULL) ? sym->documentation : "";
203204
funcdisplayname(symname,sym->name);
204205
if ((sym->usage & uMISSING)!=0)
205-
error(4,symname); /* function not defined */
206+
error(4,symname,ptr); /* function not defined */
206207
if ((sym->usage & uPROTOTYPED)==0)
207208
error(71,symname); /* operator must be declared before use */
208209
} /* if */
@@ -1979,8 +1980,9 @@ static int hier1(value *lval1)
19791980
} /* if */
19801981
} else if ((sym->usage & uMISSING)!=0) {
19811982
char symname[2*sNAMEMAX+16]; /* allow space for user defined operators */
1983+
char *ptr= (sym->documentation!=NULL) ? sym->documentation : "";
19821984
funcdisplayname(symname,sym->name);
1983-
error(4,symname); /* function not defined */
1985+
error(4,symname,ptr); /* function not defined */
19841986
} /* if */
19851987
callfunction(sym,lval1,TRUE);
19861988
return FALSE; /* result of function call is no lvalue */

source/compiler/sc5.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static char *errmsg[] = {
4343
/*001*/ "expected token: \"%s\", but found \"%s\"\n",
4444
/*002*/ "only a single statement (or expression) can follow each \"case\"\n",
4545
/*003*/ "declaration of a local variable must appear in a compound block\n",
46-
/*004*/ "function \"%s\" is not implemented\n",
46+
/*004*/ "function \"%s\" is not implemented %s\n",
4747
/*005*/ "function may not have arguments\n",
4848
/*006*/ "must be assigned to an array\n",
4949
/*007*/ "operator cannot be redefined\n",

source/compiler/tests/gh_500.meta

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
'test_type': 'output_check',
3+
'errors': """
4+
gh_500.pwn(13) : error 004: function "Test1" is not implemented - use "Test4"
5+
gh_500.pwn(14) : error 004: function "Test2" is not implemented
6+
gh_500.pwn(15) : error 004: function "Test3" is not implemented
7+
"""
8+
}

source/compiler/tests/gh_500.pwn

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#pragma deprecated - use "Test4"
2+
forward Test1();
3+
4+
#pragma deprecated
5+
forward Test2();
6+
7+
forward Test3();
8+
9+
stock Test4(){}
10+
11+
main()
12+
{
13+
Test1(); // error 004: function "Test1" is not implemented - use "Test4"
14+
Test2(); // error 004: function "Test2" is not implemented
15+
Test3(); // error 004: function "Test3" is not implemented
16+
}

0 commit comments

Comments
 (0)