diff --git a/source/compiler/sc1.c b/source/compiler/sc1.c index 43c5a7b..53b0154 100644 --- a/source/compiler/sc1.c +++ b/source/compiler/sc1.c @@ -5370,9 +5370,10 @@ static void destructsymbols(symbol *root,int level) if ((opsym=findglb(symbolname,sGLOBAL))!=NULL) { if ((opsym->usage & uMISSING)!=0 || (opsym->usage & uPROTOTYPED)==0) { char symname[2*sNAMEMAX+16]; /* allow space for user defined operators */ + char *ptr= (sym->documentation!=NULL) ? sym->documentation : ""; funcdisplayname(symname,opsym->name); if ((opsym->usage & uMISSING)!=0) - error(4,symname); /* function not defined */ + error(4,symname,ptr); /* function not defined */ if ((opsym->usage & uPROTOTYPED)==0) error(71,symname); /* operator must be declared before use */ } /* if */ diff --git a/source/compiler/sc3.c b/source/compiler/sc3.c index 886d22d..b549c33 100644 --- a/source/compiler/sc3.c +++ b/source/compiler/sc3.c @@ -200,9 +200,10 @@ static void (*unopers[])(void) = { lneg, neg, user_inc, user_dec }; /* check existence and the proper declaration of this function */ if ((sym->usage & uMISSING)!=0 || (sym->usage & uPROTOTYPED)==0) { char symname[2*sNAMEMAX+16]; /* allow space for user defined operators */ + char *ptr= (sym->documentation!=NULL) ? sym->documentation : ""; funcdisplayname(symname,sym->name); if ((sym->usage & uMISSING)!=0) - error(4,symname); /* function not defined */ + error(4,symname,ptr); /* function not defined */ if ((sym->usage & uPROTOTYPED)==0) error(71,symname); /* operator must be declared before use */ } /* if */ @@ -1979,8 +1980,9 @@ restart: } /* if */ } else if ((sym->usage & uMISSING)!=0) { char symname[2*sNAMEMAX+16]; /* allow space for user defined operators */ + char *ptr= (sym->documentation!=NULL) ? sym->documentation : ""; funcdisplayname(symname,sym->name); - error(4,symname); /* function not defined */ + error(4,symname,ptr); /* function not defined */ } /* if */ callfunction(sym,lval1,TRUE); return FALSE; /* result of function call is no lvalue */ diff --git a/source/compiler/sc5.c b/source/compiler/sc5.c index fc2eb8d..384e8e2 100644 --- a/source/compiler/sc5.c +++ b/source/compiler/sc5.c @@ -43,7 +43,7 @@ static char *errmsg[] = { /*001*/ "expected token: \"%s\", but found \"%s\"\n", /*002*/ "only a single statement (or expression) can follow each \"case\"\n", /*003*/ "declaration of a local variable must appear in a compound block\n", -/*004*/ "function \"%s\" is not implemented\n", +/*004*/ "function \"%s\" is not implemented %s\n", /*005*/ "function may not have arguments\n", /*006*/ "must be assigned to an array\n", /*007*/ "operator cannot be redefined\n", diff --git a/source/compiler/tests/gh_500.meta b/source/compiler/tests/gh_500.meta new file mode 100644 index 0000000..0ebab4f --- /dev/null +++ b/source/compiler/tests/gh_500.meta @@ -0,0 +1,8 @@ +{ + 'test_type': 'output_check', + 'errors': """ +gh_500.pwn(13) : error 004: function "Test1" is not implemented - use "Test4" +gh_500.pwn(14) : error 004: function "Test2" is not implemented +gh_500.pwn(15) : error 004: function "Test3" is not implemented +""" +} diff --git a/source/compiler/tests/gh_500.pwn b/source/compiler/tests/gh_500.pwn new file mode 100644 index 0000000..f3d0a87 --- /dev/null +++ b/source/compiler/tests/gh_500.pwn @@ -0,0 +1,16 @@ +#pragma deprecated - use "Test4" +forward Test1(); + +#pragma deprecated +forward Test2(); + +forward Test3(); + +stock Test4(){} + +main() +{ + Test1(); // error 004: function "Test1" is not implemented - use "Test4" + Test2(); // error 004: function "Test2" is not implemented + Test3(); // error 004: function "Test3" is not implemented +}