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