diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-11 11:34:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-11 11:34:25 -0400 |
commit | 5b4197845ad1a33bc57da7ee5ea41de58c2f86bf (patch) | |
tree | 87139e25612c78431584f953053ae81ead30b27b /scripts | |
parent | a22a0fdba4191473581f86c9dd5361cf581521d3 (diff) | |
parent | e062781397e5bebc6c1b8dd4bf466136e13ae4c5 (diff) |
Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull kconfig updates from Michal Marek:
"This is the kconfig part of kbuild for v3.12-rc1:
- post-3.11 search code fixes and micro-optimizations
- CONFIG_MODULES is no longer a special case; this is needed to
eventually fix the bug that using KCONFIG_ALLCONFIG breaks
allmodconfig
- long long is used to store hex and int values
- make silentoldconfig no longer warns when a symbol changes from
tristate to bool (it's a job for make oldconfig)
- scripts/diffconfig updated to work with newer Pythons
- scripts/config does not rely on GNU sed extensions"
* 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
kconfig: do not allow more than one symbol to have 'option modules'
kconfig: regenerate bison parser
kconfig: do not special-case 'MODULES' symbol
diffconfig: Update script to support python versions 2.5 through 3.3
diffconfig: Gracefully exit if the default config files are not present
modules: do not depend on kconfig to set 'modules' option to symbol MODULES
kconfig: silence warning when parsing auto.conf when a symbol has changed type
scripts/config: use sed's POSIX interface
kconfig: switch to "long long" for sanity
kconfig: simplify symbol-search code
kconfig: don't allocate n+1 elements in temporary array
kconfig: minor style fixes in symbol-search code
kconfig/[mn]conf: shorten title in search-box
kconfig: avoid multiple calls to strlen
Documentation/kconfig: more concise and straightforward search explanation
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/config | 44 | ||||
-rwxr-xr-x | scripts/diffconfig | 33 | ||||
-rw-r--r-- | scripts/kconfig/confdata.c | 11 | ||||
-rw-r--r-- | scripts/kconfig/mconf.c | 4 | ||||
-rw-r--r-- | scripts/kconfig/menu.c | 11 | ||||
-rw-r--r-- | scripts/kconfig/nconf.c | 4 | ||||
-rw-r--r-- | scripts/kconfig/symbol.c | 68 | ||||
-rw-r--r-- | scripts/kconfig/zconf.tab.c_shipped | 562 | ||||
-rw-r--r-- | scripts/kconfig/zconf.y | 11 |
9 files changed, 408 insertions, 340 deletions
diff --git a/scripts/config b/scripts/config index 567120a87c39..2283be2bb62c 100755 --- a/scripts/config +++ b/scripts/config | |||
@@ -62,15 +62,52 @@ checkarg() { | |||
62 | fi | 62 | fi |
63 | } | 63 | } |
64 | 64 | ||
65 | txt_append() { | ||
66 | local anchor="$1" | ||
67 | local insert="$2" | ||
68 | local infile="$3" | ||
69 | local tmpfile="$infile.swp" | ||
70 | |||
71 | # sed append cmd: 'a\' + newline + text + newline | ||
72 | cmd="$(printf "a\\%b$insert" "\n")" | ||
73 | |||
74 | sed -e "/$anchor/$cmd" "$infile" >"$tmpfile" | ||
75 | # replace original file with the edited one | ||
76 | mv "$tmpfile" "$infile" | ||
77 | } | ||
78 | |||
79 | txt_subst() { | ||
80 | local before="$1" | ||
81 | local after="$2" | ||
82 | local infile="$3" | ||
83 | local tmpfile="$infile.swp" | ||
84 | |||
85 | sed -e "s/$before/$after/" "$infile" >"$tmpfile" | ||
86 | # replace original file with the edited one | ||
87 | mv "$tmpfile" "$infile" | ||
88 | } | ||
89 | |||
90 | txt_delete() { | ||
91 | local text="$1" | ||
92 | local infile="$2" | ||
93 | local tmpfile="$infile.swp" | ||
94 | |||
95 | sed -e "/$text/d" "$infile" >"$tmpfile" | ||
96 | # replace original file with the edited one | ||
97 | mv "$tmpfile" "$infile" | ||
98 | } | ||
99 | |||
65 | set_var() { | 100 | set_var() { |
66 | local name=$1 new=$2 before=$3 | 101 | local name=$1 new=$2 before=$3 |
67 | 102 | ||
68 | name_re="^($name=|# $name is not set)" | 103 | name_re="^($name=|# $name is not set)" |
69 | before_re="^($before=|# $before is not set)" | 104 | before_re="^($before=|# $before is not set)" |
70 | if test -n "$before" && grep -Eq "$before_re" "$FN"; then | 105 | if test -n "$before" && grep -Eq "$before_re" "$FN"; then |
71 | sed -ri "/$before_re/a $new" "$FN" | 106 | txt_append "^$before=" "$new" "$FN" |
107 | txt_append "^# $before is not set" "$new" "$FN" | ||
72 | elif grep -Eq "$name_re" "$FN"; then | 108 | elif grep -Eq "$name_re" "$FN"; then |
73 | sed -ri "s:$name_re.*:$new:" "$FN" | 109 | txt_subst "^$name=.*" "$new" "$FN" |
110 | txt_subst "^# $name is not set" "$new" "$FN" | ||
74 | else | 111 | else |
75 | echo "$new" >>"$FN" | 112 | echo "$new" >>"$FN" |
76 | fi | 113 | fi |
@@ -79,7 +116,8 @@ set_var() { | |||
79 | undef_var() { | 116 | undef_var() { |
80 | local name=$1 | 117 | local name=$1 |
81 | 118 | ||
82 | sed -ri "/^($name=|# $name is not set)/d" "$FN" | 119 | txt_delete "^$name=" "$FN" |
120 | txt_delete "^# $name is not set" "$FN" | ||
83 | } | 121 | } |
84 | 122 | ||
85 | if [ "$1" = "--file" ]; then | 123 | if [ "$1" = "--file" ]; then |
diff --git a/scripts/diffconfig b/scripts/diffconfig index b91f3e34d44d..6d672836e187 100755 --- a/scripts/diffconfig +++ b/scripts/diffconfig | |||
@@ -10,7 +10,7 @@ | |||
10 | import sys, os | 10 | import sys, os |
11 | 11 | ||
12 | def usage(): | 12 | def usage(): |
13 | print """Usage: diffconfig [-h] [-m] [<config1> <config2>] | 13 | print("""Usage: diffconfig [-h] [-m] [<config1> <config2>] |
14 | 14 | ||
15 | Diffconfig is a simple utility for comparing two .config files. | 15 | Diffconfig is a simple utility for comparing two .config files. |
16 | Using standard diff to compare .config files often includes extraneous and | 16 | Using standard diff to compare .config files often includes extraneous and |
@@ -33,7 +33,7 @@ Example usage: | |||
33 | EXT2_FS y -> n | 33 | EXT2_FS y -> n |
34 | LOG_BUF_SHIFT 14 -> 16 | 34 | LOG_BUF_SHIFT 14 -> 16 |
35 | PRINTK_TIME n -> y | 35 | PRINTK_TIME n -> y |
36 | """ | 36 | """) |
37 | sys.exit(0) | 37 | sys.exit(0) |
38 | 38 | ||
39 | # returns a dictionary of name/value pairs for config items in the file | 39 | # returns a dictionary of name/value pairs for config items in the file |
@@ -54,23 +54,23 @@ def print_config(op, config, value, new_value): | |||
54 | if merge_style: | 54 | if merge_style: |
55 | if new_value: | 55 | if new_value: |
56 | if new_value=="n": | 56 | if new_value=="n": |
57 | print "# CONFIG_%s is not set" % config | 57 | print("# CONFIG_%s is not set" % config) |
58 | else: | 58 | else: |
59 | print "CONFIG_%s=%s" % (config, new_value) | 59 | print("CONFIG_%s=%s" % (config, new_value)) |
60 | else: | 60 | else: |
61 | if op=="-": | 61 | if op=="-": |
62 | print "-%s %s" % (config, value) | 62 | print("-%s %s" % (config, value)) |
63 | elif op=="+": | 63 | elif op=="+": |
64 | print "+%s %s" % (config, new_value) | 64 | print("+%s %s" % (config, new_value)) |
65 | else: | 65 | else: |
66 | print " %s %s -> %s" % (config, value, new_value) | 66 | print(" %s %s -> %s" % (config, value, new_value)) |
67 | 67 | ||
68 | def main(): | 68 | def main(): |
69 | global merge_style | 69 | global merge_style |
70 | 70 | ||
71 | # parse command line args | 71 | # parse command line args |
72 | if ("-h" in sys.argv or "--help" in sys.argv): | 72 | if ("-h" in sys.argv or "--help" in sys.argv): |
73 | usage() | 73 | usage() |
74 | 74 | ||
75 | merge_style = 0 | 75 | merge_style = 0 |
76 | if "-m" in sys.argv: | 76 | if "-m" in sys.argv: |
@@ -79,23 +79,27 @@ def main(): | |||
79 | 79 | ||
80 | argc = len(sys.argv) | 80 | argc = len(sys.argv) |
81 | if not (argc==1 or argc == 3): | 81 | if not (argc==1 or argc == 3): |
82 | print "Error: incorrect number of arguments or unrecognized option" | 82 | print("Error: incorrect number of arguments or unrecognized option") |
83 | usage() | 83 | usage() |
84 | 84 | ||
85 | if argc == 1: | 85 | if argc == 1: |
86 | # if no filenames given, assume .config and .config.old | 86 | # if no filenames given, assume .config and .config.old |
87 | build_dir="" | 87 | build_dir="" |
88 | if os.environ.has_key("KBUILD_OUTPUT"): | 88 | if "KBUILD_OUTPUT" in os.environ: |
89 | build_dir = os.environ["KBUILD_OUTPUT"]+"/" | 89 | build_dir = os.environ["KBUILD_OUTPUT"]+"/" |
90 | |||
91 | configa_filename = build_dir + ".config.old" | 90 | configa_filename = build_dir + ".config.old" |
92 | configb_filename = build_dir + ".config" | 91 | configb_filename = build_dir + ".config" |
93 | else: | 92 | else: |
94 | configa_filename = sys.argv[1] | 93 | configa_filename = sys.argv[1] |
95 | configb_filename = sys.argv[2] | 94 | configb_filename = sys.argv[2] |
96 | 95 | ||
97 | a = readconfig(file(configa_filename)) | 96 | try: |
98 | b = readconfig(file(configb_filename)) | 97 | a = readconfig(open(configa_filename)) |
98 | b = readconfig(open(configb_filename)) | ||
99 | except (IOError): | ||
100 | e = sys.exc_info()[1] | ||
101 | print("I/O error[%s]: %s\n" % (e.args[0],e.args[1])) | ||
102 | usage() | ||
99 | 103 | ||
100 | # print items in a but not b (accumulate, sort and print) | 104 | # print items in a but not b (accumulate, sort and print) |
101 | old = [] | 105 | old = [] |
@@ -121,8 +125,7 @@ def main(): | |||
121 | 125 | ||
122 | # now print items in b but not in a | 126 | # now print items in b but not in a |
123 | # (items from b that were in a were removed above) | 127 | # (items from b that were in a were removed above) |
124 | new = b.keys() | 128 | new = sorted(b.keys()) |
125 | new.sort() | ||
126 | for config in new: | 129 | for config in new: |
127 | print_config("+", config, None, b[config]) | 130 | print_config("+", config, None, b[config]) |
128 | 131 | ||
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index c55c227af463..87f723804079 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c | |||
@@ -140,7 +140,9 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p) | |||
140 | sym->flags |= def_flags; | 140 | sym->flags |= def_flags; |
141 | break; | 141 | break; |
142 | } | 142 | } |
143 | conf_warning("symbol value '%s' invalid for %s", p, sym->name); | 143 | if (def != S_DEF_AUTO) |
144 | conf_warning("symbol value '%s' invalid for %s", | ||
145 | p, sym->name); | ||
144 | return 1; | 146 | return 1; |
145 | case S_OTHER: | 147 | case S_OTHER: |
146 | if (*p != '"') { | 148 | if (*p != '"') { |
@@ -161,7 +163,8 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p) | |||
161 | memmove(p2, p2 + 1, strlen(p2)); | 163 | memmove(p2, p2 + 1, strlen(p2)); |
162 | } | 164 | } |
163 | if (!p2) { | 165 | if (!p2) { |
164 | conf_warning("invalid string found"); | 166 | if (def != S_DEF_AUTO) |
167 | conf_warning("invalid string found"); | ||
165 | return 1; | 168 | return 1; |
166 | } | 169 | } |
167 | /* fall through */ | 170 | /* fall through */ |
@@ -172,7 +175,9 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p) | |||
172 | sym->def[def].val = strdup(p); | 175 | sym->def[def].val = strdup(p); |
173 | sym->flags |= def_flags; | 176 | sym->flags |= def_flags; |
174 | } else { | 177 | } else { |
175 | conf_warning("symbol value '%s' invalid for %s", p, sym->name); | 178 | if (def != S_DEF_AUTO) |
179 | conf_warning("symbol value '%s' invalid for %s", | ||
180 | p, sym->name); | ||
176 | return 1; | 181 | return 1; |
177 | } | 182 | } |
178 | break; | 183 | break; |
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 6c9c45f9fbba..2c3963165a0d 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c | |||
@@ -401,8 +401,8 @@ static void search_conf(void) | |||
401 | struct subtitle_part stpart; | 401 | struct subtitle_part stpart; |
402 | 402 | ||
403 | title = str_new(); | 403 | title = str_new(); |
404 | str_printf( &title, _("Enter %s (sub)string or regexp to search for " | 404 | str_printf( &title, _("Enter (sub)string or regexp to search for " |
405 | "(with or without \"%s\")"), CONFIG_, CONFIG_); | 405 | "(with or without \"%s\")"), CONFIG_); |
406 | 406 | ||
407 | again: | 407 | again: |
408 | dialog_clear(); | 408 | dialog_clear(); |
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 7e233a6ca64e..c1d53200c306 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c | |||
@@ -197,12 +197,15 @@ void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep) | |||
197 | 197 | ||
198 | void menu_add_option(int token, char *arg) | 198 | void menu_add_option(int token, char *arg) |
199 | { | 199 | { |
200 | struct property *prop; | ||
201 | |||
202 | switch (token) { | 200 | switch (token) { |
203 | case T_OPT_MODULES: | 201 | case T_OPT_MODULES: |
204 | prop = prop_alloc(P_DEFAULT, modules_sym); | 202 | if (modules_sym) |
205 | prop->expr = expr_alloc_symbol(current_entry->sym); | 203 | zconf_error("symbol '%s' redefines option 'modules'" |
204 | " already defined by symbol '%s'", | ||
205 | current_entry->sym->name, | ||
206 | modules_sym->name | ||
207 | ); | ||
208 | modules_sym = current_entry->sym; | ||
206 | break; | 209 | break; |
207 | case T_OPT_DEFCONFIG_LIST: | 210 | case T_OPT_DEFCONFIG_LIST: |
208 | if (!sym_defconfig_list) | 211 | if (!sym_defconfig_list) |
diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c index 7975d8d258c3..4fbecd2473bc 100644 --- a/scripts/kconfig/nconf.c +++ b/scripts/kconfig/nconf.c | |||
@@ -695,8 +695,8 @@ static void search_conf(void) | |||
695 | int dres; | 695 | int dres; |
696 | 696 | ||
697 | title = str_new(); | 697 | title = str_new(); |
698 | str_printf( &title, _("Enter %s (sub)string or regexp to search for " | 698 | str_printf( &title, _("Enter (sub)string or regexp to search for " |
699 | "(with or without \"%s\")"), CONFIG_, CONFIG_); | 699 | "(with or without \"%s\")"), CONFIG_); |
700 | 700 | ||
701 | again: | 701 | again: |
702 | dres = dialog_inputbox(main_window, | 702 | dres = dialog_inputbox(main_window, |
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index d550300ec00c..c9a6775565bf 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c | |||
@@ -136,7 +136,7 @@ static struct property *sym_get_range_prop(struct symbol *sym) | |||
136 | return NULL; | 136 | return NULL; |
137 | } | 137 | } |
138 | 138 | ||
139 | static long sym_get_range_val(struct symbol *sym, int base) | 139 | static long long sym_get_range_val(struct symbol *sym, int base) |
140 | { | 140 | { |
141 | sym_calc_value(sym); | 141 | sym_calc_value(sym); |
142 | switch (sym->type) { | 142 | switch (sym->type) { |
@@ -149,13 +149,14 @@ static long sym_get_range_val(struct symbol *sym, int base) | |||
149 | default: | 149 | default: |
150 | break; | 150 | break; |
151 | } | 151 | } |
152 | return strtol(sym->curr.val, NULL, base); | 152 | return strtoll(sym->curr.val, NULL, base); |
153 | } | 153 | } |
154 | 154 | ||
155 | static void sym_validate_range(struct symbol *sym) | 155 | static void sym_validate_range(struct symbol *sym) |
156 | { | 156 | { |
157 | struct property *prop; | 157 | struct property *prop; |
158 | long base, val, val2; | 158 | int base; |
159 | long long val, val2; | ||
159 | char str[64]; | 160 | char str[64]; |
160 | 161 | ||
161 | switch (sym->type) { | 162 | switch (sym->type) { |
@@ -171,7 +172,7 @@ static void sym_validate_range(struct symbol *sym) | |||
171 | prop = sym_get_range_prop(sym); | 172 | prop = sym_get_range_prop(sym); |
172 | if (!prop) | 173 | if (!prop) |
173 | return; | 174 | return; |
174 | val = strtol(sym->curr.val, NULL, base); | 175 | val = strtoll(sym->curr.val, NULL, base); |
175 | val2 = sym_get_range_val(prop->expr->left.sym, base); | 176 | val2 = sym_get_range_val(prop->expr->left.sym, base); |
176 | if (val >= val2) { | 177 | if (val >= val2) { |
177 | val2 = sym_get_range_val(prop->expr->right.sym, base); | 178 | val2 = sym_get_range_val(prop->expr->right.sym, base); |
@@ -179,9 +180,9 @@ static void sym_validate_range(struct symbol *sym) | |||
179 | return; | 180 | return; |
180 | } | 181 | } |
181 | if (sym->type == S_INT) | 182 | if (sym->type == S_INT) |
182 | sprintf(str, "%ld", val2); | 183 | sprintf(str, "%lld", val2); |
183 | else | 184 | else |
184 | sprintf(str, "0x%lx", val2); | 185 | sprintf(str, "0x%llx", val2); |
185 | sym->curr.val = strdup(str); | 186 | sym->curr.val = strdup(str); |
186 | } | 187 | } |
187 | 188 | ||
@@ -594,7 +595,7 @@ bool sym_string_valid(struct symbol *sym, const char *str) | |||
594 | bool sym_string_within_range(struct symbol *sym, const char *str) | 595 | bool sym_string_within_range(struct symbol *sym, const char *str) |
595 | { | 596 | { |
596 | struct property *prop; | 597 | struct property *prop; |
597 | long val; | 598 | long long val; |
598 | 599 | ||
599 | switch (sym->type) { | 600 | switch (sym->type) { |
600 | case S_STRING: | 601 | case S_STRING: |
@@ -605,7 +606,7 @@ bool sym_string_within_range(struct symbol *sym, const char *str) | |||
605 | prop = sym_get_range_prop(sym); | 606 | prop = sym_get_range_prop(sym); |
606 | if (!prop) | 607 | if (!prop) |
607 | return true; | 608 | return true; |
608 | val = strtol(str, NULL, 10); | 609 | val = strtoll(str, NULL, 10); |
609 | return val >= sym_get_range_val(prop->expr->left.sym, 10) && | 610 | return val >= sym_get_range_val(prop->expr->left.sym, 10) && |
610 | val <= sym_get_range_val(prop->expr->right.sym, 10); | 611 | val <= sym_get_range_val(prop->expr->right.sym, 10); |
611 | case S_HEX: | 612 | case S_HEX: |
@@ -614,7 +615,7 @@ bool sym_string_within_range(struct symbol *sym, const char *str) | |||
614 | prop = sym_get_range_prop(sym); | 615 | prop = sym_get_range_prop(sym); |
615 | if (!prop) | 616 | if (!prop) |
616 | return true; | 617 | return true; |
617 | val = strtol(str, NULL, 16); | 618 | val = strtoll(str, NULL, 16); |
618 | return val >= sym_get_range_val(prop->expr->left.sym, 16) && | 619 | return val >= sym_get_range_val(prop->expr->left.sym, 16) && |
619 | val <= sym_get_range_val(prop->expr->right.sym, 16); | 620 | val <= sym_get_range_val(prop->expr->right.sym, 16); |
620 | case S_BOOLEAN: | 621 | case S_BOOLEAN: |
@@ -963,11 +964,11 @@ struct sym_match { | |||
963 | * - first, symbols that match exactly | 964 | * - first, symbols that match exactly |
964 | * - then, alphabetical sort | 965 | * - then, alphabetical sort |
965 | */ | 966 | */ |
966 | static int sym_rel_comp( const void *sym1, const void *sym2 ) | 967 | static int sym_rel_comp(const void *sym1, const void *sym2) |
967 | { | 968 | { |
968 | struct sym_match *s1 = *(struct sym_match **)sym1; | 969 | const struct sym_match *s1 = sym1; |
969 | struct sym_match *s2 = *(struct sym_match **)sym2; | 970 | const struct sym_match *s2 = sym2; |
970 | int l1, l2; | 971 | int exact1, exact2; |
971 | 972 | ||
972 | /* Exact match: | 973 | /* Exact match: |
973 | * - if matched length on symbol s1 is the length of that symbol, | 974 | * - if matched length on symbol s1 is the length of that symbol, |
@@ -978,11 +979,11 @@ static int sym_rel_comp( const void *sym1, const void *sym2 ) | |||
978 | * exactly; if this is the case, we can't decide which comes first, | 979 | * exactly; if this is the case, we can't decide which comes first, |
979 | * and we fallback to sorting alphabetically. | 980 | * and we fallback to sorting alphabetically. |
980 | */ | 981 | */ |
981 | l1 = s1->eo - s1->so; | 982 | exact1 = (s1->eo - s1->so) == strlen(s1->sym->name); |
982 | l2 = s2->eo - s2->so; | 983 | exact2 = (s2->eo - s2->so) == strlen(s2->sym->name); |
983 | if (l1 == strlen(s1->sym->name) && l2 != strlen(s2->sym->name)) | 984 | if (exact1 && !exact2) |
984 | return -1; | 985 | return -1; |
985 | if (l1 != strlen(s1->sym->name) && l2 == strlen(s2->sym->name)) | 986 | if (!exact1 && exact2) |
986 | return 1; | 987 | return 1; |
987 | 988 | ||
988 | /* As a fallback, sort symbols alphabetically */ | 989 | /* As a fallback, sort symbols alphabetically */ |
@@ -992,7 +993,7 @@ static int sym_rel_comp( const void *sym1, const void *sym2 ) | |||
992 | struct symbol **sym_re_search(const char *pattern) | 993 | struct symbol **sym_re_search(const char *pattern) |
993 | { | 994 | { |
994 | struct symbol *sym, **sym_arr = NULL; | 995 | struct symbol *sym, **sym_arr = NULL; |
995 | struct sym_match **sym_match_arr = NULL; | 996 | struct sym_match *sym_match_arr = NULL; |
996 | int i, cnt, size; | 997 | int i, cnt, size; |
997 | regex_t re; | 998 | regex_t re; |
998 | regmatch_t match[1]; | 999 | regmatch_t match[1]; |
@@ -1005,47 +1006,38 @@ struct symbol **sym_re_search(const char *pattern) | |||
1005 | return NULL; | 1006 | return NULL; |
1006 | 1007 | ||
1007 | for_all_symbols(i, sym) { | 1008 | for_all_symbols(i, sym) { |
1008 | struct sym_match *tmp_sym_match; | ||
1009 | if (sym->flags & SYMBOL_CONST || !sym->name) | 1009 | if (sym->flags & SYMBOL_CONST || !sym->name) |
1010 | continue; | 1010 | continue; |
1011 | if (regexec(&re, sym->name, 1, match, 0)) | 1011 | if (regexec(&re, sym->name, 1, match, 0)) |
1012 | continue; | 1012 | continue; |
1013 | if (cnt + 1 >= size) { | 1013 | if (cnt >= size) { |
1014 | void *tmp; | 1014 | void *tmp; |
1015 | size += 16; | 1015 | size += 16; |
1016 | tmp = realloc(sym_match_arr, size * sizeof(struct sym_match *)); | 1016 | tmp = realloc(sym_match_arr, size * sizeof(struct sym_match)); |
1017 | if (!tmp) { | 1017 | if (!tmp) |
1018 | goto sym_re_search_free; | 1018 | goto sym_re_search_free; |
1019 | } | ||
1020 | sym_match_arr = tmp; | 1019 | sym_match_arr = tmp; |
1021 | } | 1020 | } |
1022 | sym_calc_value(sym); | 1021 | sym_calc_value(sym); |
1023 | tmp_sym_match = (struct sym_match*)malloc(sizeof(struct sym_match)); | 1022 | /* As regexec returned 0, we know we have a match, so |
1024 | if (!tmp_sym_match) | ||
1025 | goto sym_re_search_free; | ||
1026 | tmp_sym_match->sym = sym; | ||
1027 | /* As regexec return 0, we know we have a match, so | ||
1028 | * we can use match[0].rm_[se]o without further checks | 1023 | * we can use match[0].rm_[se]o without further checks |
1029 | */ | 1024 | */ |
1030 | tmp_sym_match->so = match[0].rm_so; | 1025 | sym_match_arr[cnt].so = match[0].rm_so; |
1031 | tmp_sym_match->eo = match[0].rm_eo; | 1026 | sym_match_arr[cnt].eo = match[0].rm_eo; |
1032 | sym_match_arr[cnt++] = tmp_sym_match; | 1027 | sym_match_arr[cnt++].sym = sym; |
1033 | } | 1028 | } |
1034 | if (sym_match_arr) { | 1029 | if (sym_match_arr) { |
1035 | qsort(sym_match_arr, cnt, sizeof(struct sym_match*), sym_rel_comp); | 1030 | qsort(sym_match_arr, cnt, sizeof(struct sym_match), sym_rel_comp); |
1036 | sym_arr = malloc((cnt+1) * sizeof(struct symbol)); | 1031 | sym_arr = malloc((cnt+1) * sizeof(struct symbol)); |
1037 | if (!sym_arr) | 1032 | if (!sym_arr) |
1038 | goto sym_re_search_free; | 1033 | goto sym_re_search_free; |
1039 | for (i = 0; i < cnt; i++) | 1034 | for (i = 0; i < cnt; i++) |
1040 | sym_arr[i] = sym_match_arr[i]->sym; | 1035 | sym_arr[i] = sym_match_arr[i].sym; |
1041 | sym_arr[cnt] = NULL; | 1036 | sym_arr[cnt] = NULL; |
1042 | } | 1037 | } |
1043 | sym_re_search_free: | 1038 | sym_re_search_free: |
1044 | if (sym_match_arr) { | 1039 | /* sym_match_arr can be NULL if no match, but free(NULL) is OK */ |
1045 | for (i = 0; i < cnt; i++) | 1040 | free(sym_match_arr); |
1046 | free(sym_match_arr[i]); | ||
1047 | free(sym_match_arr); | ||
1048 | } | ||
1049 | regfree(&re); | 1041 | regfree(&re); |
1050 | 1042 | ||
1051 | return sym_arr; | 1043 | return sym_arr; |
diff --git a/scripts/kconfig/zconf.tab.c_shipped b/scripts/kconfig/zconf.tab.c_shipped index f636141e7bfd..25ae16ac75c8 100644 --- a/scripts/kconfig/zconf.tab.c_shipped +++ b/scripts/kconfig/zconf.tab.c_shipped | |||
@@ -1,9 +1,8 @@ | |||
1 | /* A Bison parser, made by GNU Bison 2.4.3. */ | 1 | /* A Bison parser, made by GNU Bison 2.5. */ |
2 | 2 | ||
3 | /* Skeleton implementation for Bison's Yacc-like parsers in C | 3 | /* Bison implementation for Yacc-like parsers in C |
4 | 4 | ||
5 | Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, | 5 | Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. |
6 | 2009, 2010 Free Software Foundation, Inc. | ||
7 | 6 | ||
8 | This program is free software: you can redistribute it and/or modify | 7 | This program is free software: you can redistribute it and/or modify |
9 | it under the terms of the GNU General Public License as published by | 8 | it under the terms of the GNU General Public License as published by |
@@ -45,7 +44,7 @@ | |||
45 | #define YYBISON 1 | 44 | #define YYBISON 1 |
46 | 45 | ||
47 | /* Bison version. */ | 46 | /* Bison version. */ |
48 | #define YYBISON_VERSION "2.4.3" | 47 | #define YYBISON_VERSION "2.5" |
49 | 48 | ||
50 | /* Skeleton name. */ | 49 | /* Skeleton name. */ |
51 | #define YYSKELETON_NAME "yacc.c" | 50 | #define YYSKELETON_NAME "yacc.c" |
@@ -302,11 +301,11 @@ YYID (yyi) | |||
302 | # define alloca _alloca | 301 | # define alloca _alloca |
303 | # else | 302 | # else |
304 | # define YYSTACK_ALLOC alloca | 303 | # define YYSTACK_ALLOC alloca |
305 | # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ | 304 | # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ |
306 | || defined __cplusplus || defined _MSC_VER) | 305 | || defined __cplusplus || defined _MSC_VER) |
307 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ | 306 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
308 | # ifndef _STDLIB_H | 307 | # ifndef EXIT_SUCCESS |
309 | # define _STDLIB_H 1 | 308 | # define EXIT_SUCCESS 0 |
310 | # endif | 309 | # endif |
311 | # endif | 310 | # endif |
312 | # endif | 311 | # endif |
@@ -329,24 +328,24 @@ YYID (yyi) | |||
329 | # ifndef YYSTACK_ALLOC_MAXIMUM | 328 | # ifndef YYSTACK_ALLOC_MAXIMUM |
330 | # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM | 329 | # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
331 | # endif | 330 | # endif |
332 | # if (defined __cplusplus && ! defined _STDLIB_H \ | 331 | # if (defined __cplusplus && ! defined EXIT_SUCCESS \ |
333 | && ! ((defined YYMALLOC || defined malloc) \ | 332 | && ! ((defined YYMALLOC || defined malloc) \ |
334 | && (defined YYFREE || defined free))) | 333 | && (defined YYFREE || defined free))) |
335 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ | 334 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
336 | # ifndef _STDLIB_H | 335 | # ifndef EXIT_SUCCESS |
337 | # define _STDLIB_H 1 | 336 | # define EXIT_SUCCESS 0 |
338 | # endif | 337 | # endif |
339 | # endif | 338 | # endif |
340 | # ifndef YYMALLOC | 339 | # ifndef YYMALLOC |
341 | # define YYMALLOC malloc | 340 | # define YYMALLOC malloc |
342 | # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ | 341 | # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ |
343 | || defined __cplusplus || defined _MSC_VER) | 342 | || defined __cplusplus || defined _MSC_VER) |
344 | void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ | 343 | void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ |
345 | # endif | 344 | # endif |
346 | # endif | 345 | # endif |
347 | # ifndef YYFREE | 346 | # ifndef YYFREE |
348 | # define YYFREE free | 347 | # define YYFREE free |
349 | # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ | 348 | # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ |
350 | || defined __cplusplus || defined _MSC_VER) | 349 | || defined __cplusplus || defined _MSC_VER) |
351 | void free (void *); /* INFRINGES ON USER NAME SPACE */ | 350 | void free (void *); /* INFRINGES ON USER NAME SPACE */ |
352 | # endif | 351 | # endif |
@@ -375,23 +374,7 @@ union yyalloc | |||
375 | ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ | 374 | ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ |
376 | + YYSTACK_GAP_MAXIMUM) | 375 | + YYSTACK_GAP_MAXIMUM) |
377 | 376 | ||
378 | /* Copy COUNT objects from FROM to TO. The source and destination do | 377 | # define YYCOPY_NEEDED 1 |
379 | not overlap. */ | ||
380 | # ifndef YYCOPY | ||
381 | # if defined __GNUC__ && 1 < __GNUC__ | ||
382 | # define YYCOPY(To, From, Count) \ | ||
383 | __builtin_memcpy (To, From, (Count) * sizeof (*(From))) | ||
384 | # else | ||
385 | # define YYCOPY(To, From, Count) \ | ||
386 | do \ | ||
387 | { \ | ||
388 | YYSIZE_T yyi; \ | ||
389 | for (yyi = 0; yyi < (Count); yyi++) \ | ||
390 | (To)[yyi] = (From)[yyi]; \ | ||
391 | } \ | ||
392 | while (YYID (0)) | ||
393 | # endif | ||
394 | # endif | ||
395 | 378 | ||
396 | /* Relocate STACK from its old location to the new one. The | 379 | /* Relocate STACK from its old location to the new one. The |
397 | local variables YYSIZE and YYSTACKSIZE give the old and new number of | 380 | local variables YYSIZE and YYSTACKSIZE give the old and new number of |
@@ -411,6 +394,26 @@ union yyalloc | |||
411 | 394 | ||
412 | #endif | 395 | #endif |
413 | 396 | ||
397 | #if defined YYCOPY_NEEDED && YYCOPY_NEEDED | ||
398 | /* Copy COUNT objects from FROM to TO. The source and destination do | ||
399 | not overlap. */ | ||
400 | # ifndef YYCOPY | ||
401 | # if defined __GNUC__ && 1 < __GNUC__ | ||
402 | # define YYCOPY(To, From, Count) \ | ||
403 | __builtin_memcpy (To, From, (Count) * sizeof (*(From))) | ||
404 | # else | ||
405 | # define YYCOPY(To, From, Count) \ | ||
406 | do \ | ||
407 | { \ | ||
408 | YYSIZE_T yyi; \ | ||
409 | for (yyi = 0; yyi < (Count); yyi++) \ | ||
410 | (To)[yyi] = (From)[yyi]; \ | ||
411 | } \ | ||
412 | while (YYID (0)) | ||
413 | # endif | ||
414 | # endif | ||
415 | #endif /* !YYCOPY_NEEDED */ | ||
416 | |||
414 | /* YYFINAL -- State number of the termination state. */ | 417 | /* YYFINAL -- State number of the termination state. */ |
415 | #define YYFINAL 11 | 418 | #define YYFINAL 11 |
416 | /* YYLAST -- Last index in YYTABLE. */ | 419 | /* YYLAST -- Last index in YYTABLE. */ |
@@ -529,18 +532,18 @@ static const yytype_int8 yyrhs[] = | |||
529 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ | 532 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ |
530 | static const yytype_uint16 yyrline[] = | 533 | static const yytype_uint16 yyrline[] = |
531 | { | 534 | { |
532 | 0, 104, 104, 104, 106, 106, 108, 110, 111, 112, | 535 | 0, 103, 103, 103, 105, 105, 107, 109, 110, 111, |
533 | 113, 114, 115, 119, 123, 123, 123, 123, 123, 123, | 536 | 112, 113, 114, 118, 122, 122, 122, 122, 122, 122, |
534 | 123, 123, 127, 128, 129, 130, 131, 132, 136, 137, | 537 | 122, 122, 126, 127, 128, 129, 130, 131, 135, 136, |
535 | 143, 151, 157, 165, 175, 177, 178, 179, 180, 181, | 538 | 142, 150, 156, 164, 174, 176, 177, 178, 179, 180, |
536 | 182, 185, 193, 199, 209, 215, 221, 224, 226, 237, | 539 | 181, 184, 192, 198, 208, 214, 220, 223, 225, 236, |
537 | 238, 243, 252, 257, 265, 268, 270, 271, 272, 273, | 540 | 237, 242, 251, 256, 264, 267, 269, 270, 271, 272, |
538 | 274, 277, 283, 294, 300, 310, 312, 317, 325, 333, | 541 | 273, 276, 282, 293, 299, 309, 311, 316, 324, 332, |
539 | 336, 338, 339, 340, 345, 352, 359, 364, 372, 375, | 542 | 335, 337, 338, 339, 344, 351, 358, 363, 371, 374, |
540 | 377, 378, 379, 382, 390, 397, 404, 410, 417, 419, | 543 | 376, 377, 378, 381, 389, 396, 403, 409, 416, 418, |
541 | 420, 421, 424, 432, 434, 435, 438, 445, 447, 452, | 544 | 419, 420, 423, 431, 433, 434, 437, 444, 446, 451, |
542 | 453, 456, 457, 458, 462, 463, 466, 467, 470, 471, | 545 | 452, 455, 456, 457, 461, 462, 465, 466, 469, 470, |
543 | 472, 473, 474, 475, 476, 479, 480, 483, 484 | 546 | 471, 472, 473, 474, 475, 478, 479, 482, 483 |
544 | }; | 547 | }; |
545 | #endif | 548 | #endif |
546 | 549 | ||
@@ -615,8 +618,8 @@ static const yytype_uint8 yyr2[] = | |||
615 | 3, 3, 2, 3, 3, 1, 1, 0, 1 | 618 | 3, 3, 2, 3, 3, 1, 1, 0, 1 |
616 | }; | 619 | }; |
617 | 620 | ||
618 | /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state | 621 | /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. |
619 | STATE-NUM when YYTABLE doesn't specify something else to do. Zero | 622 | Performed when YYTABLE doesn't specify something else to do. Zero |
620 | means the default is an error. */ | 623 | means the default is an error. */ |
621 | static const yytype_uint8 yydefact[] = | 624 | static const yytype_uint8 yydefact[] = |
622 | { | 625 | { |
@@ -691,8 +694,7 @@ static const yytype_int16 yypgoto[] = | |||
691 | 694 | ||
692 | /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If | 695 | /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If |
693 | positive, shift that token. If negative, reduce the rule which | 696 | positive, shift that token. If negative, reduce the rule which |
694 | number is the opposite. If zero, do what YYDEFACT says. | 697 | number is the opposite. If YYTABLE_NINF, syntax error. */ |
695 | If YYTABLE_NINF, syntax error. */ | ||
696 | #define YYTABLE_NINF -86 | 698 | #define YYTABLE_NINF -86 |
697 | static const yytype_int16 yytable[] = | 699 | static const yytype_int16 yytable[] = |
698 | { | 700 | { |
@@ -728,6 +730,12 @@ static const yytype_int16 yytable[] = | |||
728 | 184 | 730 | 184 |
729 | }; | 731 | }; |
730 | 732 | ||
733 | #define yypact_value_is_default(yystate) \ | ||
734 | ((yystate) == (-90)) | ||
735 | |||
736 | #define yytable_value_is_error(yytable_value) \ | ||
737 | YYID (0) | ||
738 | |||
731 | static const yytype_int16 yycheck[] = | 739 | static const yytype_int16 yycheck[] = |
732 | { | 740 | { |
733 | 1, 67, 68, 10, 93, 94, 76, 3, 76, 14, | 741 | 1, 67, 68, 10, 93, 94, 76, 3, 76, 14, |
@@ -821,7 +829,6 @@ do \ | |||
821 | { \ | 829 | { \ |
822 | yychar = (Token); \ | 830 | yychar = (Token); \ |
823 | yylval = (Value); \ | 831 | yylval = (Value); \ |
824 | yytoken = YYTRANSLATE (yychar); \ | ||
825 | YYPOPSTACK (1); \ | 832 | YYPOPSTACK (1); \ |
826 | goto yybackup; \ | 833 | goto yybackup; \ |
827 | } \ | 834 | } \ |
@@ -863,19 +870,10 @@ while (YYID (0)) | |||
863 | #endif | 870 | #endif |
864 | 871 | ||
865 | 872 | ||
866 | /* YY_LOCATION_PRINT -- Print the location on the stream. | 873 | /* This macro is provided for backward compatibility. */ |
867 | This macro was not mandated originally: define only if we know | ||
868 | we won't break user code: when these are the locations we know. */ | ||
869 | 874 | ||
870 | #ifndef YY_LOCATION_PRINT | 875 | #ifndef YY_LOCATION_PRINT |
871 | # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL | 876 | # define YY_LOCATION_PRINT(File, Loc) ((void) 0) |
872 | # define YY_LOCATION_PRINT(File, Loc) \ | ||
873 | fprintf (File, "%d.%d-%d.%d", \ | ||
874 | (Loc).first_line, (Loc).first_column, \ | ||
875 | (Loc).last_line, (Loc).last_column) | ||
876 | # else | ||
877 | # define YY_LOCATION_PRINT(File, Loc) ((void) 0) | ||
878 | # endif | ||
879 | #endif | 877 | #endif |
880 | 878 | ||
881 | 879 | ||
@@ -1067,7 +1065,6 @@ int yydebug; | |||
1067 | # define YYMAXDEPTH 10000 | 1065 | # define YYMAXDEPTH 10000 |
1068 | #endif | 1066 | #endif |
1069 | 1067 | ||
1070 | |||
1071 | 1068 | ||
1072 | #if YYERROR_VERBOSE | 1069 | #if YYERROR_VERBOSE |
1073 | 1070 | ||
@@ -1170,115 +1167,142 @@ yytnamerr (char *yyres, const char *yystr) | |||
1170 | } | 1167 | } |
1171 | # endif | 1168 | # endif |
1172 | 1169 | ||
1173 | /* Copy into YYRESULT an error message about the unexpected token | 1170 | /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message |
1174 | YYCHAR while in state YYSTATE. Return the number of bytes copied, | 1171 | about the unexpected token YYTOKEN for the state stack whose top is |
1175 | including the terminating null byte. If YYRESULT is null, do not | 1172 | YYSSP. |
1176 | copy anything; just return the number of bytes that would be | ||
1177 | copied. As a special case, return 0 if an ordinary "syntax error" | ||
1178 | message will do. Return YYSIZE_MAXIMUM if overflow occurs during | ||
1179 | size calculation. */ | ||
1180 | static YYSIZE_T | ||
1181 | yysyntax_error (char *yyresult, int yystate, int yychar) | ||
1182 | { | ||
1183 | int yyn = yypact[yystate]; | ||
1184 | 1173 | ||
1185 | if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) | 1174 | Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is |
1186 | return 0; | 1175 | not large enough to hold the message. In that case, also set |
1187 | else | 1176 | *YYMSG_ALLOC to the required number of bytes. Return 2 if the |
1177 | required number of bytes is too large to store. */ | ||
1178 | static int | ||
1179 | yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | ||
1180 | yytype_int16 *yyssp, int yytoken) | ||
1181 | { | ||
1182 | YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); | ||
1183 | YYSIZE_T yysize = yysize0; | ||
1184 | YYSIZE_T yysize1; | ||
1185 | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; | ||
1186 | /* Internationalized format string. */ | ||
1187 | const char *yyformat = 0; | ||
1188 | /* Arguments of yyformat. */ | ||
1189 | char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; | ||
1190 | /* Number of reported tokens (one for the "unexpected", one per | ||
1191 | "expected"). */ | ||
1192 | int yycount = 0; | ||
1193 | |||
1194 | /* There are many possibilities here to consider: | ||
1195 | - Assume YYFAIL is not used. It's too flawed to consider. See | ||
1196 | <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> | ||
1197 | for details. YYERROR is fine as it does not invoke this | ||
1198 | function. | ||
1199 | - If this state is a consistent state with a default action, then | ||
1200 | the only way this function was invoked is if the default action | ||
1201 | is an error action. In that case, don't check for expected | ||
1202 | tokens because there are none. | ||
1203 | - The only way there can be no lookahead present (in yychar) is if | ||
1204 | this state is a consistent state with a default action. Thus, | ||
1205 | detecting the absence of a lookahead is sufficient to determine | ||
1206 | that there is no unexpected or expected token to report. In that | ||
1207 | case, just report a simple "syntax error". | ||
1208 | - Don't assume there isn't a lookahead just because this state is a | ||
1209 | consistent state with a default action. There might have been a | ||
1210 | previous inconsistent state, consistent state with a non-default | ||
1211 | action, or user semantic action that manipulated yychar. | ||
1212 | - Of course, the expected token list depends on states to have | ||
1213 | correct lookahead information, and it depends on the parser not | ||
1214 | to perform extra reductions after fetching a lookahead from the | ||
1215 | scanner and before detecting a syntax error. Thus, state merging | ||
1216 | (from LALR or IELR) and default reductions corrupt the expected | ||
1217 | token list. However, the list is correct for canonical LR with | ||
1218 | one exception: it will still contain any token that will not be | ||
1219 | accepted due to an error action in a later state. | ||
1220 | */ | ||
1221 | if (yytoken != YYEMPTY) | ||
1188 | { | 1222 | { |
1189 | int yytype = YYTRANSLATE (yychar); | 1223 | int yyn = yypact[*yyssp]; |
1190 | YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); | 1224 | yyarg[yycount++] = yytname[yytoken]; |
1191 | YYSIZE_T yysize = yysize0; | 1225 | if (!yypact_value_is_default (yyn)) |
1192 | YYSIZE_T yysize1; | 1226 | { |
1193 | int yysize_overflow = 0; | 1227 | /* Start YYX at -YYN if negative to avoid negative indexes in |
1194 | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; | 1228 | YYCHECK. In other words, skip the first -YYN actions for |
1195 | char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; | 1229 | this state because they are default actions. */ |
1196 | int yyx; | 1230 | int yyxbegin = yyn < 0 ? -yyn : 0; |
1197 | 1231 | /* Stay within bounds of both yycheck and yytname. */ | |
1198 | # if 0 | 1232 | int yychecklim = YYLAST - yyn + 1; |
1199 | /* This is so xgettext sees the translatable formats that are | 1233 | int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; |
1200 | constructed on the fly. */ | 1234 | int yyx; |
1201 | YY_("syntax error, unexpected %s"); | 1235 | |
1202 | YY_("syntax error, unexpected %s, expecting %s"); | 1236 | for (yyx = yyxbegin; yyx < yyxend; ++yyx) |
1203 | YY_("syntax error, unexpected %s, expecting %s or %s"); | 1237 | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR |
1204 | YY_("syntax error, unexpected %s, expecting %s or %s or %s"); | 1238 | && !yytable_value_is_error (yytable[yyx + yyn])) |
1205 | YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); | 1239 | { |
1206 | # endif | 1240 | if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) |
1207 | char *yyfmt; | 1241 | { |
1208 | char const *yyf; | 1242 | yycount = 1; |
1209 | static char const yyunexpected[] = "syntax error, unexpected %s"; | 1243 | yysize = yysize0; |
1210 | static char const yyexpecting[] = ", expecting %s"; | 1244 | break; |
1211 | static char const yyor[] = " or %s"; | 1245 | } |
1212 | char yyformat[sizeof yyunexpected | 1246 | yyarg[yycount++] = yytname[yyx]; |
1213 | + sizeof yyexpecting - 1 | 1247 | yysize1 = yysize + yytnamerr (0, yytname[yyx]); |
1214 | + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) | 1248 | if (! (yysize <= yysize1 |
1215 | * (sizeof yyor - 1))]; | 1249 | && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) |
1216 | char const *yyprefix = yyexpecting; | 1250 | return 2; |
1217 | 1251 | yysize = yysize1; | |
1218 | /* Start YYX at -YYN if negative to avoid negative indexes in | 1252 | } |
1219 | YYCHECK. */ | 1253 | } |
1220 | int yyxbegin = yyn < 0 ? -yyn : 0; | 1254 | } |
1221 | |||
1222 | /* Stay within bounds of both yycheck and yytname. */ | ||
1223 | int yychecklim = YYLAST - yyn + 1; | ||
1224 | int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; | ||
1225 | int yycount = 1; | ||
1226 | |||
1227 | yyarg[0] = yytname[yytype]; | ||
1228 | yyfmt = yystpcpy (yyformat, yyunexpected); | ||
1229 | |||
1230 | for (yyx = yyxbegin; yyx < yyxend; ++yyx) | ||
1231 | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) | ||
1232 | { | ||
1233 | if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) | ||
1234 | { | ||
1235 | yycount = 1; | ||
1236 | yysize = yysize0; | ||
1237 | yyformat[sizeof yyunexpected - 1] = '\0'; | ||
1238 | break; | ||
1239 | } | ||
1240 | yyarg[yycount++] = yytname[yyx]; | ||
1241 | yysize1 = yysize + yytnamerr (0, yytname[yyx]); | ||
1242 | yysize_overflow |= (yysize1 < yysize); | ||
1243 | yysize = yysize1; | ||
1244 | yyfmt = yystpcpy (yyfmt, yyprefix); | ||
1245 | yyprefix = yyor; | ||
1246 | } | ||
1247 | 1255 | ||
1248 | yyf = YY_(yyformat); | 1256 | switch (yycount) |
1249 | yysize1 = yysize + yystrlen (yyf); | 1257 | { |
1250 | yysize_overflow |= (yysize1 < yysize); | 1258 | # define YYCASE_(N, S) \ |
1251 | yysize = yysize1; | 1259 | case N: \ |
1260 | yyformat = S; \ | ||
1261 | break | ||
1262 | YYCASE_(0, YY_("syntax error")); | ||
1263 | YYCASE_(1, YY_("syntax error, unexpected %s")); | ||
1264 | YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); | ||
1265 | YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); | ||
1266 | YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); | ||
1267 | YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); | ||
1268 | # undef YYCASE_ | ||
1269 | } | ||
1252 | 1270 | ||
1253 | if (yysize_overflow) | 1271 | yysize1 = yysize + yystrlen (yyformat); |
1254 | return YYSIZE_MAXIMUM; | 1272 | if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) |
1273 | return 2; | ||
1274 | yysize = yysize1; | ||
1255 | 1275 | ||
1256 | if (yyresult) | 1276 | if (*yymsg_alloc < yysize) |
1257 | { | 1277 | { |
1258 | /* Avoid sprintf, as that infringes on the user's name space. | 1278 | *yymsg_alloc = 2 * yysize; |
1259 | Don't have undefined behavior even if the translation | 1279 | if (! (yysize <= *yymsg_alloc |
1260 | produced a string with the wrong number of "%s"s. */ | 1280 | && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) |
1261 | char *yyp = yyresult; | 1281 | *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; |
1262 | int yyi = 0; | 1282 | return 1; |
1263 | while ((*yyp = *yyf) != '\0') | ||
1264 | { | ||
1265 | if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) | ||
1266 | { | ||
1267 | yyp += yytnamerr (yyp, yyarg[yyi++]); | ||
1268 | yyf += 2; | ||
1269 | } | ||
1270 | else | ||
1271 | { | ||
1272 | yyp++; | ||
1273 | yyf++; | ||
1274 | } | ||
1275 | } | ||
1276 | } | ||
1277 | return yysize; | ||
1278 | } | 1283 | } |
1284 | |||
1285 | /* Avoid sprintf, as that infringes on the user's name space. | ||
1286 | Don't have undefined behavior even if the translation | ||
1287 | produced a string with the wrong number of "%s"s. */ | ||
1288 | { | ||
1289 | char *yyp = *yymsg; | ||
1290 | int yyi = 0; | ||
1291 | while ((*yyp = *yyformat) != '\0') | ||
1292 | if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) | ||
1293 | { | ||
1294 | yyp += yytnamerr (yyp, yyarg[yyi++]); | ||
1295 | yyformat += 2; | ||
1296 | } | ||
1297 | else | ||
1298 | { | ||
1299 | yyp++; | ||
1300 | yyformat++; | ||
1301 | } | ||
1302 | } | ||
1303 | return 0; | ||
1279 | } | 1304 | } |
1280 | #endif /* YYERROR_VERBOSE */ | 1305 | #endif /* YYERROR_VERBOSE */ |
1281 | |||
1282 | 1306 | ||
1283 | /*-----------------------------------------------. | 1307 | /*-----------------------------------------------. |
1284 | | Release the memory associated to this symbol. | | 1308 | | Release the memory associated to this symbol. | |
@@ -1341,6 +1365,7 @@ yydestruct (yymsg, yytype, yyvaluep) | |||
1341 | } | 1365 | } |
1342 | } | 1366 | } |
1343 | 1367 | ||
1368 | |||
1344 | /* Prevent warnings from -Wmissing-prototypes. */ | 1369 | /* Prevent warnings from -Wmissing-prototypes. */ |
1345 | #ifdef YYPARSE_PARAM | 1370 | #ifdef YYPARSE_PARAM |
1346 | #if defined __STDC__ || defined __cplusplus | 1371 | #if defined __STDC__ || defined __cplusplus |
@@ -1367,10 +1392,9 @@ YYSTYPE yylval; | |||
1367 | int yynerrs; | 1392 | int yynerrs; |
1368 | 1393 | ||
1369 | 1394 | ||
1370 | 1395 | /*----------. | |
1371 | /*-------------------------. | 1396 | | yyparse. | |
1372 | | yyparse or yypush_parse. | | 1397 | `----------*/ |
1373 | `-------------------------*/ | ||
1374 | 1398 | ||
1375 | #ifdef YYPARSE_PARAM | 1399 | #ifdef YYPARSE_PARAM |
1376 | #if (defined __STDC__ || defined __C99__FUNC__ \ | 1400 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
@@ -1394,8 +1418,6 @@ yyparse () | |||
1394 | #endif | 1418 | #endif |
1395 | #endif | 1419 | #endif |
1396 | { | 1420 | { |
1397 | |||
1398 | |||
1399 | int yystate; | 1421 | int yystate; |
1400 | /* Number of tokens to shift before error messages enabled. */ | 1422 | /* Number of tokens to shift before error messages enabled. */ |
1401 | int yyerrstatus; | 1423 | int yyerrstatus; |
@@ -1550,7 +1572,7 @@ yybackup: | |||
1550 | 1572 | ||
1551 | /* First try to decide what to do without reference to lookahead token. */ | 1573 | /* First try to decide what to do without reference to lookahead token. */ |
1552 | yyn = yypact[yystate]; | 1574 | yyn = yypact[yystate]; |
1553 | if (yyn == YYPACT_NINF) | 1575 | if (yypact_value_is_default (yyn)) |
1554 | goto yydefault; | 1576 | goto yydefault; |
1555 | 1577 | ||
1556 | /* Not known => get a lookahead token if don't already have one. */ | 1578 | /* Not known => get a lookahead token if don't already have one. */ |
@@ -1581,8 +1603,8 @@ yybackup: | |||
1581 | yyn = yytable[yyn]; | 1603 | yyn = yytable[yyn]; |
1582 | if (yyn <= 0) | 1604 | if (yyn <= 0) |
1583 | { | 1605 | { |
1584 | if (yyn == 0 || yyn == YYTABLE_NINF) | 1606 | if (yytable_value_is_error (yyn)) |
1585 | goto yyerrlab; | 1607 | goto yyerrlab; |
1586 | yyn = -yyn; | 1608 | yyn = -yyn; |
1587 | goto yyreduce; | 1609 | goto yyreduce; |
1588 | } | 1610 | } |
@@ -1637,34 +1659,34 @@ yyreduce: | |||
1637 | { | 1659 | { |
1638 | case 10: | 1660 | case 10: |
1639 | 1661 | ||
1640 | { zconf_error("unexpected end statement"); ;} | 1662 | { zconf_error("unexpected end statement"); } |
1641 | break; | 1663 | break; |
1642 | 1664 | ||
1643 | case 11: | 1665 | case 11: |
1644 | 1666 | ||
1645 | { zconf_error("unknown statement \"%s\"", (yyvsp[(2) - (4)].string)); ;} | 1667 | { zconf_error("unknown statement \"%s\"", (yyvsp[(2) - (4)].string)); } |
1646 | break; | 1668 | break; |
1647 | 1669 | ||
1648 | case 12: | 1670 | case 12: |
1649 | 1671 | ||
1650 | { | 1672 | { |
1651 | zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[(2) - (4)].id)->name); | 1673 | zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[(2) - (4)].id)->name); |
1652 | ;} | 1674 | } |
1653 | break; | 1675 | break; |
1654 | 1676 | ||
1655 | case 13: | 1677 | case 13: |
1656 | 1678 | ||
1657 | { zconf_error("invalid statement"); ;} | 1679 | { zconf_error("invalid statement"); } |
1658 | break; | 1680 | break; |
1659 | 1681 | ||
1660 | case 28: | 1682 | case 28: |
1661 | 1683 | ||
1662 | { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); ;} | 1684 | { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); } |
1663 | break; | 1685 | break; |
1664 | 1686 | ||
1665 | case 29: | 1687 | case 29: |
1666 | 1688 | ||
1667 | { zconf_error("invalid option"); ;} | 1689 | { zconf_error("invalid option"); } |
1668 | break; | 1690 | break; |
1669 | 1691 | ||
1670 | case 30: | 1692 | case 30: |
@@ -1674,7 +1696,7 @@ yyreduce: | |||
1674 | sym->flags |= SYMBOL_OPTIONAL; | 1696 | sym->flags |= SYMBOL_OPTIONAL; |
1675 | menu_add_entry(sym); | 1697 | menu_add_entry(sym); |
1676 | printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string)); | 1698 | printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string)); |
1677 | ;} | 1699 | } |
1678 | break; | 1700 | break; |
1679 | 1701 | ||
1680 | case 31: | 1702 | case 31: |
@@ -1682,7 +1704,7 @@ yyreduce: | |||
1682 | { | 1704 | { |
1683 | menu_end_entry(); | 1705 | menu_end_entry(); |
1684 | printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno()); | 1706 | printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno()); |
1685 | ;} | 1707 | } |
1686 | break; | 1708 | break; |
1687 | 1709 | ||
1688 | case 32: | 1710 | case 32: |
@@ -1692,7 +1714,7 @@ yyreduce: | |||
1692 | sym->flags |= SYMBOL_OPTIONAL; | 1714 | sym->flags |= SYMBOL_OPTIONAL; |
1693 | menu_add_entry(sym); | 1715 | menu_add_entry(sym); |
1694 | printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string)); | 1716 | printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string)); |
1695 | ;} | 1717 | } |
1696 | break; | 1718 | break; |
1697 | 1719 | ||
1698 | case 33: | 1720 | case 33: |
@@ -1704,7 +1726,7 @@ yyreduce: | |||
1704 | zconfprint("warning: menuconfig statement without prompt"); | 1726 | zconfprint("warning: menuconfig statement without prompt"); |
1705 | menu_end_entry(); | 1727 | menu_end_entry(); |
1706 | printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno()); | 1728 | printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno()); |
1707 | ;} | 1729 | } |
1708 | break; | 1730 | break; |
1709 | 1731 | ||
1710 | case 41: | 1732 | case 41: |
@@ -1714,7 +1736,7 @@ yyreduce: | |||
1714 | printd(DEBUG_PARSE, "%s:%d:type(%u)\n", | 1736 | printd(DEBUG_PARSE, "%s:%d:type(%u)\n", |
1715 | zconf_curname(), zconf_lineno(), | 1737 | zconf_curname(), zconf_lineno(), |
1716 | (yyvsp[(1) - (3)].id)->stype); | 1738 | (yyvsp[(1) - (3)].id)->stype); |
1717 | ;} | 1739 | } |
1718 | break; | 1740 | break; |
1719 | 1741 | ||
1720 | case 42: | 1742 | case 42: |
@@ -1722,7 +1744,7 @@ yyreduce: | |||
1722 | { | 1744 | { |
1723 | menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr)); | 1745 | menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr)); |
1724 | printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); | 1746 | printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); |
1725 | ;} | 1747 | } |
1726 | break; | 1748 | break; |
1727 | 1749 | ||
1728 | case 43: | 1750 | case 43: |
@@ -1734,7 +1756,7 @@ yyreduce: | |||
1734 | printd(DEBUG_PARSE, "%s:%d:default(%u)\n", | 1756 | printd(DEBUG_PARSE, "%s:%d:default(%u)\n", |
1735 | zconf_curname(), zconf_lineno(), | 1757 | zconf_curname(), zconf_lineno(), |
1736 | (yyvsp[(1) - (4)].id)->stype); | 1758 | (yyvsp[(1) - (4)].id)->stype); |
1737 | ;} | 1759 | } |
1738 | break; | 1760 | break; |
1739 | 1761 | ||
1740 | case 44: | 1762 | case 44: |
@@ -1742,7 +1764,7 @@ yyreduce: | |||
1742 | { | 1764 | { |
1743 | menu_add_symbol(P_SELECT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr)); | 1765 | menu_add_symbol(P_SELECT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr)); |
1744 | printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno()); | 1766 | printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno()); |
1745 | ;} | 1767 | } |
1746 | break; | 1768 | break; |
1747 | 1769 | ||
1748 | case 45: | 1770 | case 45: |
@@ -1750,7 +1772,7 @@ yyreduce: | |||
1750 | { | 1772 | { |
1751 | menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[(2) - (5)].symbol), (yyvsp[(3) - (5)].symbol)), (yyvsp[(4) - (5)].expr)); | 1773 | menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[(2) - (5)].symbol), (yyvsp[(3) - (5)].symbol)), (yyvsp[(4) - (5)].expr)); |
1752 | printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno()); | 1774 | printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno()); |
1753 | ;} | 1775 | } |
1754 | break; | 1776 | break; |
1755 | 1777 | ||
1756 | case 48: | 1778 | case 48: |
@@ -1762,17 +1784,17 @@ yyreduce: | |||
1762 | else | 1784 | else |
1763 | zconfprint("warning: ignoring unknown option %s", (yyvsp[(2) - (3)].string)); | 1785 | zconfprint("warning: ignoring unknown option %s", (yyvsp[(2) - (3)].string)); |
1764 | free((yyvsp[(2) - (3)].string)); | 1786 | free((yyvsp[(2) - (3)].string)); |
1765 | ;} | 1787 | } |
1766 | break; | 1788 | break; |
1767 | 1789 | ||
1768 | case 49: | 1790 | case 49: |
1769 | 1791 | ||
1770 | { (yyval.string) = NULL; ;} | 1792 | { (yyval.string) = NULL; } |
1771 | break; | 1793 | break; |
1772 | 1794 | ||
1773 | case 50: | 1795 | case 50: |
1774 | 1796 | ||
1775 | { (yyval.string) = (yyvsp[(2) - (2)].string); ;} | 1797 | { (yyval.string) = (yyvsp[(2) - (2)].string); } |
1776 | break; | 1798 | break; |
1777 | 1799 | ||
1778 | case 51: | 1800 | case 51: |
@@ -1783,14 +1805,14 @@ yyreduce: | |||
1783 | menu_add_entry(sym); | 1805 | menu_add_entry(sym); |
1784 | menu_add_expr(P_CHOICE, NULL, NULL); | 1806 | menu_add_expr(P_CHOICE, NULL, NULL); |
1785 | printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno()); | 1807 | printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno()); |
1786 | ;} | 1808 | } |
1787 | break; | 1809 | break; |
1788 | 1810 | ||
1789 | case 52: | 1811 | case 52: |
1790 | 1812 | ||
1791 | { | 1813 | { |
1792 | (yyval.menu) = menu_add_menu(); | 1814 | (yyval.menu) = menu_add_menu(); |
1793 | ;} | 1815 | } |
1794 | break; | 1816 | break; |
1795 | 1817 | ||
1796 | case 53: | 1818 | case 53: |
@@ -1800,7 +1822,7 @@ yyreduce: | |||
1800 | menu_end_menu(); | 1822 | menu_end_menu(); |
1801 | printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno()); | 1823 | printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno()); |
1802 | } | 1824 | } |
1803 | ;} | 1825 | } |
1804 | break; | 1826 | break; |
1805 | 1827 | ||
1806 | case 61: | 1828 | case 61: |
@@ -1808,7 +1830,7 @@ yyreduce: | |||
1808 | { | 1830 | { |
1809 | menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr)); | 1831 | menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr)); |
1810 | printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); | 1832 | printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); |
1811 | ;} | 1833 | } |
1812 | break; | 1834 | break; |
1813 | 1835 | ||
1814 | case 62: | 1836 | case 62: |
@@ -1821,7 +1843,7 @@ yyreduce: | |||
1821 | (yyvsp[(1) - (3)].id)->stype); | 1843 | (yyvsp[(1) - (3)].id)->stype); |
1822 | } else | 1844 | } else |
1823 | YYERROR; | 1845 | YYERROR; |
1824 | ;} | 1846 | } |
1825 | break; | 1847 | break; |
1826 | 1848 | ||
1827 | case 63: | 1849 | case 63: |
@@ -1829,7 +1851,7 @@ yyreduce: | |||
1829 | { | 1851 | { |
1830 | current_entry->sym->flags |= SYMBOL_OPTIONAL; | 1852 | current_entry->sym->flags |= SYMBOL_OPTIONAL; |
1831 | printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno()); | 1853 | printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno()); |
1832 | ;} | 1854 | } |
1833 | break; | 1855 | break; |
1834 | 1856 | ||
1835 | case 64: | 1857 | case 64: |
@@ -1841,7 +1863,7 @@ yyreduce: | |||
1841 | zconf_curname(), zconf_lineno()); | 1863 | zconf_curname(), zconf_lineno()); |
1842 | } else | 1864 | } else |
1843 | YYERROR; | 1865 | YYERROR; |
1844 | ;} | 1866 | } |
1845 | break; | 1867 | break; |
1846 | 1868 | ||
1847 | case 67: | 1869 | case 67: |
@@ -1851,7 +1873,7 @@ yyreduce: | |||
1851 | menu_add_entry(NULL); | 1873 | menu_add_entry(NULL); |
1852 | menu_add_dep((yyvsp[(2) - (3)].expr)); | 1874 | menu_add_dep((yyvsp[(2) - (3)].expr)); |
1853 | (yyval.menu) = menu_add_menu(); | 1875 | (yyval.menu) = menu_add_menu(); |
1854 | ;} | 1876 | } |
1855 | break; | 1877 | break; |
1856 | 1878 | ||
1857 | case 68: | 1879 | case 68: |
@@ -1861,14 +1883,14 @@ yyreduce: | |||
1861 | menu_end_menu(); | 1883 | menu_end_menu(); |
1862 | printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno()); | 1884 | printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno()); |
1863 | } | 1885 | } |
1864 | ;} | 1886 | } |
1865 | break; | 1887 | break; |
1866 | 1888 | ||
1867 | case 74: | 1889 | case 74: |
1868 | 1890 | ||
1869 | { | 1891 | { |
1870 | menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL); | 1892 | menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL); |
1871 | ;} | 1893 | } |
1872 | break; | 1894 | break; |
1873 | 1895 | ||
1874 | case 75: | 1896 | case 75: |
@@ -1877,14 +1899,14 @@ yyreduce: | |||
1877 | menu_add_entry(NULL); | 1899 | menu_add_entry(NULL); |
1878 | menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL); | 1900 | menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL); |
1879 | printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno()); | 1901 | printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno()); |
1880 | ;} | 1902 | } |
1881 | break; | 1903 | break; |
1882 | 1904 | ||
1883 | case 76: | 1905 | case 76: |
1884 | 1906 | ||
1885 | { | 1907 | { |
1886 | (yyval.menu) = menu_add_menu(); | 1908 | (yyval.menu) = menu_add_menu(); |
1887 | ;} | 1909 | } |
1888 | break; | 1910 | break; |
1889 | 1911 | ||
1890 | case 77: | 1912 | case 77: |
@@ -1894,7 +1916,7 @@ yyreduce: | |||
1894 | menu_end_menu(); | 1916 | menu_end_menu(); |
1895 | printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno()); | 1917 | printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno()); |
1896 | } | 1918 | } |
1897 | ;} | 1919 | } |
1898 | break; | 1920 | break; |
1899 | 1921 | ||
1900 | case 83: | 1922 | case 83: |
@@ -1902,7 +1924,7 @@ yyreduce: | |||
1902 | { | 1924 | { |
1903 | printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string)); | 1925 | printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string)); |
1904 | zconf_nextfile((yyvsp[(2) - (3)].string)); | 1926 | zconf_nextfile((yyvsp[(2) - (3)].string)); |
1905 | ;} | 1927 | } |
1906 | break; | 1928 | break; |
1907 | 1929 | ||
1908 | case 84: | 1930 | case 84: |
@@ -1911,14 +1933,14 @@ yyreduce: | |||
1911 | menu_add_entry(NULL); | 1933 | menu_add_entry(NULL); |
1912 | menu_add_prompt(P_COMMENT, (yyvsp[(2) - (3)].string), NULL); | 1934 | menu_add_prompt(P_COMMENT, (yyvsp[(2) - (3)].string), NULL); |
1913 | printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno()); | 1935 | printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno()); |
1914 | ;} | 1936 | } |
1915 | break; | 1937 | break; |
1916 | 1938 | ||
1917 | case 85: | 1939 | case 85: |
1918 | 1940 | ||
1919 | { | 1941 | { |
1920 | menu_end_entry(); | 1942 | menu_end_entry(); |
1921 | ;} | 1943 | } |
1922 | break; | 1944 | break; |
1923 | 1945 | ||
1924 | case 86: | 1946 | case 86: |
@@ -1926,14 +1948,14 @@ yyreduce: | |||
1926 | { | 1948 | { |
1927 | printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno()); | 1949 | printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno()); |
1928 | zconf_starthelp(); | 1950 | zconf_starthelp(); |
1929 | ;} | 1951 | } |
1930 | break; | 1952 | break; |
1931 | 1953 | ||
1932 | case 87: | 1954 | case 87: |
1933 | 1955 | ||
1934 | { | 1956 | { |
1935 | current_entry->help = (yyvsp[(2) - (2)].string); | 1957 | current_entry->help = (yyvsp[(2) - (2)].string); |
1936 | ;} | 1958 | } |
1937 | break; | 1959 | break; |
1938 | 1960 | ||
1939 | case 92: | 1961 | case 92: |
@@ -1941,102 +1963,113 @@ yyreduce: | |||
1941 | { | 1963 | { |
1942 | menu_add_dep((yyvsp[(3) - (4)].expr)); | 1964 | menu_add_dep((yyvsp[(3) - (4)].expr)); |
1943 | printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno()); | 1965 | printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno()); |
1944 | ;} | 1966 | } |
1945 | break; | 1967 | break; |
1946 | 1968 | ||
1947 | case 96: | 1969 | case 96: |
1948 | 1970 | ||
1949 | { | 1971 | { |
1950 | menu_add_visibility((yyvsp[(2) - (2)].expr)); | 1972 | menu_add_visibility((yyvsp[(2) - (2)].expr)); |
1951 | ;} | 1973 | } |
1952 | break; | 1974 | break; |
1953 | 1975 | ||
1954 | case 98: | 1976 | case 98: |
1955 | 1977 | ||
1956 | { | 1978 | { |
1957 | menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr)); | 1979 | menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr)); |
1958 | ;} | 1980 | } |
1959 | break; | 1981 | break; |
1960 | 1982 | ||
1961 | case 101: | 1983 | case 101: |
1962 | 1984 | ||
1963 | { (yyval.id) = (yyvsp[(1) - (2)].id); ;} | 1985 | { (yyval.id) = (yyvsp[(1) - (2)].id); } |
1964 | break; | 1986 | break; |
1965 | 1987 | ||
1966 | case 102: | 1988 | case 102: |
1967 | 1989 | ||
1968 | { (yyval.id) = (yyvsp[(1) - (2)].id); ;} | 1990 | { (yyval.id) = (yyvsp[(1) - (2)].id); } |
1969 | break; | 1991 | break; |
1970 | 1992 | ||
1971 | case 103: | 1993 | case 103: |
1972 | 1994 | ||
1973 | { (yyval.id) = (yyvsp[(1) - (2)].id); ;} | 1995 | { (yyval.id) = (yyvsp[(1) - (2)].id); } |
1974 | break; | 1996 | break; |
1975 | 1997 | ||
1976 | case 106: | 1998 | case 106: |
1977 | 1999 | ||
1978 | { (yyval.expr) = NULL; ;} | 2000 | { (yyval.expr) = NULL; } |
1979 | break; | 2001 | break; |
1980 | 2002 | ||
1981 | case 107: | 2003 | case 107: |
1982 | 2004 | ||
1983 | { (yyval.expr) = (yyvsp[(2) - (2)].expr); ;} | 2005 | { (yyval.expr) = (yyvsp[(2) - (2)].expr); } |
1984 | break; | 2006 | break; |
1985 | 2007 | ||
1986 | case 108: | 2008 | case 108: |
1987 | 2009 | ||
1988 | { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); ;} | 2010 | { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); } |
1989 | break; | 2011 | break; |
1990 | 2012 | ||
1991 | case 109: | 2013 | case 109: |
1992 | 2014 | ||
1993 | { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;} | 2015 | { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); } |
1994 | break; | 2016 | break; |
1995 | 2017 | ||
1996 | case 110: | 2018 | case 110: |
1997 | 2019 | ||
1998 | { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;} | 2020 | { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); } |
1999 | break; | 2021 | break; |
2000 | 2022 | ||
2001 | case 111: | 2023 | case 111: |
2002 | 2024 | ||
2003 | { (yyval.expr) = (yyvsp[(2) - (3)].expr); ;} | 2025 | { (yyval.expr) = (yyvsp[(2) - (3)].expr); } |
2004 | break; | 2026 | break; |
2005 | 2027 | ||
2006 | case 112: | 2028 | case 112: |
2007 | 2029 | ||
2008 | { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); ;} | 2030 | { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); } |
2009 | break; | 2031 | break; |
2010 | 2032 | ||
2011 | case 113: | 2033 | case 113: |
2012 | 2034 | ||
2013 | { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;} | 2035 | { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } |
2014 | break; | 2036 | break; |
2015 | 2037 | ||
2016 | case 114: | 2038 | case 114: |
2017 | 2039 | ||
2018 | { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;} | 2040 | { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } |
2019 | break; | 2041 | break; |
2020 | 2042 | ||
2021 | case 115: | 2043 | case 115: |
2022 | 2044 | ||
2023 | { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 0); free((yyvsp[(1) - (1)].string)); ;} | 2045 | { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 0); free((yyvsp[(1) - (1)].string)); } |
2024 | break; | 2046 | break; |
2025 | 2047 | ||
2026 | case 116: | 2048 | case 116: |
2027 | 2049 | ||
2028 | { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), SYMBOL_CONST); free((yyvsp[(1) - (1)].string)); ;} | 2050 | { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), SYMBOL_CONST); free((yyvsp[(1) - (1)].string)); } |
2029 | break; | 2051 | break; |
2030 | 2052 | ||
2031 | case 117: | 2053 | case 117: |
2032 | 2054 | ||
2033 | { (yyval.string) = NULL; ;} | 2055 | { (yyval.string) = NULL; } |
2034 | break; | 2056 | break; |
2035 | 2057 | ||
2036 | 2058 | ||
2037 | 2059 | ||
2038 | default: break; | 2060 | default: break; |
2039 | } | 2061 | } |
2062 | /* User semantic actions sometimes alter yychar, and that requires | ||
2063 | that yytoken be updated with the new translation. We take the | ||
2064 | approach of translating immediately before every use of yytoken. | ||
2065 | One alternative is translating here after every semantic action, | ||
2066 | but that translation would be missed if the semantic action invokes | ||
2067 | YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or | ||
2068 | if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an | ||
2069 | incorrect destructor might then be invoked immediately. In the | ||
2070 | case of YYERROR or YYBACKUP, subsequent parser actions might lead | ||
2071 | to an incorrect destructor call or verbose syntax error message | ||
2072 | before the lookahead is translated. */ | ||
2040 | YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); | 2073 | YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); |
2041 | 2074 | ||
2042 | YYPOPSTACK (yylen); | 2075 | YYPOPSTACK (yylen); |
@@ -2064,6 +2097,10 @@ yyreduce: | |||
2064 | | yyerrlab -- here on detecting error | | 2097 | | yyerrlab -- here on detecting error | |
2065 | `------------------------------------*/ | 2098 | `------------------------------------*/ |
2066 | yyerrlab: | 2099 | yyerrlab: |
2100 | /* Make sure we have latest lookahead translation. See comments at | ||
2101 | user semantic actions for why this is necessary. */ | ||
2102 | yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); | ||
2103 | |||
2067 | /* If not already recovering from an error, report this error. */ | 2104 | /* If not already recovering from an error, report this error. */ |
2068 | if (!yyerrstatus) | 2105 | if (!yyerrstatus) |
2069 | { | 2106 | { |
@@ -2071,37 +2108,36 @@ yyerrlab: | |||
2071 | #if ! YYERROR_VERBOSE | 2108 | #if ! YYERROR_VERBOSE |
2072 | yyerror (YY_("syntax error")); | 2109 | yyerror (YY_("syntax error")); |
2073 | #else | 2110 | #else |
2111 | # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ | ||
2112 | yyssp, yytoken) | ||
2074 | { | 2113 | { |
2075 | YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); | 2114 | char const *yymsgp = YY_("syntax error"); |
2076 | if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) | 2115 | int yysyntax_error_status; |
2077 | { | 2116 | yysyntax_error_status = YYSYNTAX_ERROR; |
2078 | YYSIZE_T yyalloc = 2 * yysize; | 2117 | if (yysyntax_error_status == 0) |
2079 | if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) | 2118 | yymsgp = yymsg; |
2080 | yyalloc = YYSTACK_ALLOC_MAXIMUM; | 2119 | else if (yysyntax_error_status == 1) |
2081 | if (yymsg != yymsgbuf) | 2120 | { |
2082 | YYSTACK_FREE (yymsg); | 2121 | if (yymsg != yymsgbuf) |
2083 | yymsg = (char *) YYSTACK_ALLOC (yyalloc); | 2122 | YYSTACK_FREE (yymsg); |
2084 | if (yymsg) | 2123 | yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); |
2085 | yymsg_alloc = yyalloc; | 2124 | if (!yymsg) |
2086 | else | 2125 | { |
2087 | { | 2126 | yymsg = yymsgbuf; |
2088 | yymsg = yymsgbuf; | 2127 | yymsg_alloc = sizeof yymsgbuf; |
2089 | yymsg_alloc = sizeof yymsgbuf; | 2128 | yysyntax_error_status = 2; |
2090 | } | 2129 | } |
2091 | } | 2130 | else |
2092 | 2131 | { | |
2093 | if (0 < yysize && yysize <= yymsg_alloc) | 2132 | yysyntax_error_status = YYSYNTAX_ERROR; |
2094 | { | 2133 | yymsgp = yymsg; |
2095 | (void) yysyntax_error (yymsg, yystate, yychar); | 2134 | } |
2096 | yyerror (yymsg); | 2135 | } |
2097 | } | 2136 | yyerror (yymsgp); |
2098 | else | 2137 | if (yysyntax_error_status == 2) |
2099 | { | 2138 | goto yyexhaustedlab; |
2100 | yyerror (YY_("syntax error")); | ||
2101 | if (yysize != 0) | ||
2102 | goto yyexhaustedlab; | ||
2103 | } | ||
2104 | } | 2139 | } |
2140 | # undef YYSYNTAX_ERROR | ||
2105 | #endif | 2141 | #endif |
2106 | } | 2142 | } |
2107 | 2143 | ||
@@ -2160,7 +2196,7 @@ yyerrlab1: | |||
2160 | for (;;) | 2196 | for (;;) |
2161 | { | 2197 | { |
2162 | yyn = yypact[yystate]; | 2198 | yyn = yypact[yystate]; |
2163 | if (yyn != YYPACT_NINF) | 2199 | if (!yypact_value_is_default (yyn)) |
2164 | { | 2200 | { |
2165 | yyn += YYTERROR; | 2201 | yyn += YYTERROR; |
2166 | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) | 2202 | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) |
@@ -2219,8 +2255,13 @@ yyexhaustedlab: | |||
2219 | 2255 | ||
2220 | yyreturn: | 2256 | yyreturn: |
2221 | if (yychar != YYEMPTY) | 2257 | if (yychar != YYEMPTY) |
2222 | yydestruct ("Cleanup: discarding lookahead", | 2258 | { |
2223 | yytoken, &yylval); | 2259 | /* Make sure we have latest lookahead translation. See comments at |
2260 | user semantic actions for why this is necessary. */ | ||
2261 | yytoken = YYTRANSLATE (yychar); | ||
2262 | yydestruct ("Cleanup: discarding lookahead", | ||
2263 | yytoken, &yylval); | ||
2264 | } | ||
2224 | /* Do not reclaim the symbols of the rule which action triggered | 2265 | /* Do not reclaim the symbols of the rule which action triggered |
2225 | this YYABORT or YYACCEPT. */ | 2266 | this YYABORT or YYACCEPT. */ |
2226 | YYPOPSTACK (yylen); | 2267 | YYPOPSTACK (yylen); |
@@ -2256,9 +2297,6 @@ void conf_parse(const char *name) | |||
2256 | 2297 | ||
2257 | sym_init(); | 2298 | sym_init(); |
2258 | _menu_init(); | 2299 | _menu_init(); |
2259 | modules_sym = sym_lookup(NULL, 0); | ||
2260 | modules_sym->type = S_BOOLEAN; | ||
2261 | modules_sym->flags |= SYMBOL_AUTO; | ||
2262 | rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); | 2300 | rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); |
2263 | 2301 | ||
2264 | if (getenv("ZCONF_DEBUG")) | 2302 | if (getenv("ZCONF_DEBUG")) |
@@ -2266,12 +2304,8 @@ void conf_parse(const char *name) | |||
2266 | zconfparse(); | 2304 | zconfparse(); |
2267 | if (zconfnerrs) | 2305 | if (zconfnerrs) |
2268 | exit(1); | 2306 | exit(1); |
2269 | if (!modules_sym->prop) { | 2307 | if (!modules_sym) |
2270 | struct property *prop; | 2308 | modules_sym = sym_find( "n" ); |
2271 | |||
2272 | prop = prop_alloc(P_DEFAULT, modules_sym); | ||
2273 | prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0)); | ||
2274 | } | ||
2275 | 2309 | ||
2276 | rootmenu.prompt->text = _(rootmenu.prompt->text); | 2310 | rootmenu.prompt->text = _(rootmenu.prompt->text); |
2277 | rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text); | 2311 | rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text); |
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 864da07ba4aa..0653886fac48 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y | |||
@@ -493,9 +493,6 @@ void conf_parse(const char *name) | |||
493 | 493 | ||
494 | sym_init(); | 494 | sym_init(); |
495 | _menu_init(); | 495 | _menu_init(); |
496 | modules_sym = sym_lookup(NULL, 0); | ||
497 | modules_sym->type = S_BOOLEAN; | ||
498 | modules_sym->flags |= SYMBOL_AUTO; | ||
499 | rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); | 496 | rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); |
500 | 497 | ||
501 | if (getenv("ZCONF_DEBUG")) | 498 | if (getenv("ZCONF_DEBUG")) |
@@ -503,12 +500,8 @@ void conf_parse(const char *name) | |||
503 | zconfparse(); | 500 | zconfparse(); |
504 | if (zconfnerrs) | 501 | if (zconfnerrs) |
505 | exit(1); | 502 | exit(1); |
506 | if (!modules_sym->prop) { | 503 | if (!modules_sym) |
507 | struct property *prop; | 504 | modules_sym = sym_find( "n" ); |
508 | |||
509 | prop = prop_alloc(P_DEFAULT, modules_sym); | ||
510 | prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0)); | ||
511 | } | ||
512 | 505 | ||
513 | rootmenu.prompt->text = _(rootmenu.prompt->text); | 506 | rootmenu.prompt->text = _(rootmenu.prompt->text); |
514 | rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text); | 507 | rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text); |