Missing macro arguments are an error

This commit is contained in:
Cary R 2021-01-10 19:22:35 -08:00
parent 5f281d5f21
commit 9eb77116b9
1 changed files with 4 additions and 0 deletions

View File

@ -817,6 +817,7 @@ static void check_for_max_args(void)
if (def_argc == MAX_DEF_ARG) { if (def_argc == MAX_DEF_ARG) {
emit_pathline(istack); emit_pathline(istack);
fprintf(stderr, "error: too many macro arguments - aborting\n"); fprintf(stderr, "error: too many macro arguments - aborting\n");
error_count += 1;
exit(1); exit(1);
} }
} }
@ -1460,6 +1461,7 @@ static void expand_using_args(void)
if (def_argc > cur_macro->argc) { if (def_argc > cur_macro->argc) {
emit_pathline(istack); emit_pathline(istack);
fprintf(stderr, "error: too many arguments for `%s\n", cur_macro->name); fprintf(stderr, "error: too many arguments for `%s\n", cur_macro->name);
error_count += 1;
return; return;
} }
while (def_argc < cur_macro->argc) { while (def_argc < cur_macro->argc) {
@ -1470,6 +1472,7 @@ static void expand_using_args(void)
} }
emit_pathline(istack); emit_pathline(istack);
fprintf(stderr, "error: too few arguments for `%s\n", cur_macro->name); fprintf(stderr, "error: too few arguments for `%s\n", cur_macro->name);
error_count += 1;
return; return;
} }
assert(def_argc == cur_macro->argc); assert(def_argc == cur_macro->argc);
@ -1694,6 +1697,7 @@ static void include_filename(void)
emit_pathline(istack); emit_pathline(istack);
fprintf(stderr, fprintf(stderr,
"error: malformed `include directive. Extra junk on line?\n"); "error: malformed `include directive. Extra junk on line?\n");
error_count += 1;
exit(1); exit(1);
} }