Improve confusing error message when calling function procedures from a

top-level statement.

Fixes: #30
This commit is contained in:
David Given 2017-01-08 11:25:57 +01:00
parent ee5ef73dfb
commit 612e14b4b4

View file

@ -676,7 +676,8 @@ label exit_label;
assert(nd == nd1); assert(nd == nd1);
if (nd->nd_type != 0) if (nd->nd_type != 0)
{ {
node_error(nd, "procedure call expected instead of function call"); node_error(nd, "only proper procedures can be called from top-level "
"statement; this is a function procedure");
break; break;
} }
CodeCall(nd); CodeCall(nd);