98 |
|
|
99 |
|
|
100 |
|
|
101 |
/* Give friendly warnings if a builtin macro is passed an inappropriate |
/* Give friendly warnings if a builtin macro is passed an |
102 |
number of arguments. NAME is macro name for messages, ARGC is actual |
inappropriate number of arguments. NAME is macro name for |
103 |
number of arguments, MIN is the minimum number of acceptable arguments, |
messages, ARGC is actual number of arguments, MIN is the minimum |
104 |
negative if not applicable, MAX is the maximum number, negative if not |
number of acceptable arguments, negative if not applicable, MAX is |
105 |
applicable. */ |
the maximum number, negative if not applicable. ARGC, MIN, and MAX |
106 |
|
count ARGV[0], the name of the macro. */ |
107 |
boolean |
boolean |
108 |
m4_bad_argc (m4_token *token, int argc, int min, int max) |
m4_bad_argc (m4_token *token, int argc, int min, int max) |
109 |
{ |
{ |
111 |
{ |
{ |
112 |
M4WARN ((warning_status, 0, |
M4WARN ((warning_status, 0, |
113 |
_("Warning: %s: too few arguments: %d < %d"), |
_("Warning: %s: too few arguments: %d < %d"), |
114 |
TOKEN_TEXT (token), argc, min)); |
TOKEN_TEXT (token), argc - 1, min - 1)); |
115 |
return TRUE; |
return TRUE; |
116 |
} |
} |
117 |
|
|
119 |
{ |
{ |
120 |
M4WARN ((warning_status, 0, |
M4WARN ((warning_status, 0, |
121 |
_("Warning: %s: too many arguments (ignored): %d > %d"), |
_("Warning: %s: too many arguments (ignored): %d > %d"), |
122 |
TOKEN_TEXT (token), argc, max)); |
TOKEN_TEXT (token), argc - 1, max - 1)); |
123 |
/* Return FALSE, otherwise it is not exactly `ignored'. */ |
/* Return FALSE, otherwise it is not exactly `ignored'. */ |
124 |
return FALSE; |
return FALSE; |
125 |
} |
} |