History

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

Linus Torvalds committed 13 years ago

Commit 5b419782 parents a22a0fd e06278112 files · +413 −345Browse files

Unified · Split

12 files
  1. Documentation/kbuild/kconfig-language.txt +1 −0
  2. Documentation/kbuild/kconfig.txt +3 −5
  3. init/Kconfig +1 −0
  4. scripts/config +41 −3
  5. scripts/diffconfig +18 −15
  6. scripts/kconfig/confdata.c +8 −3
  7. scripts/kconfig/mconf.c +2 −2
  8. scripts/kconfig/menu.c +7 −4
  9. scripts/kconfig/nconf.c +2 −2
  10. scripts/kconfig/symbol.c +30 −38
  11. scripts/kconfig/zconf.tab.c_shipped +298 −264
  12. scripts/kconfig/zconf.y +2 −9
Documentation/kbuild/kconfig-language.txt+1−0
@@ -147,6 +147,7 @@ applicable everywhere (see syntax). · 146 unmodified lines
147147 - "modules"
148148 This declares the symbol to be used as the MODULES symbol, which
149149 enables the third modular state for all config symbols.
150+ At most one symbol may have the "modules" option set.
150151
151152 - "env"=<value>
152153 This imports the environment variable into Kconfig. It behaves like
Documentation/kbuild/kconfig.txt+3−5
@@ -175,11 +175,9 @@ Searching in menuconfig: · 174 unmodified lines
175175 /^hotplug
176176
177177 When searching, symbols are sorted thus:
178− - exact match first: an exact match is when the search matches
179− the complete symbol name;
180− - alphabetical order: when two symbols do not match exactly,
181− they are sorted in alphabetical order (in the user's current
182− locale).
178+ - first, exact matches, sorted alphabetically (an exact match
179+ is when the search matches the complete symbol name);
180+ - then, other matches, sorted alphabetically.
183181 For example: ^ATH.K matches:
184182 ATH5K ATH9K ATH5K_AHB ATH5K_DEBUG [...] ATH6KL ATH6KL_DEBUG
185183 [...] ATH9K_AHB ATH9K_BTCOEX_SUPPORT ATH9K_COMMON [...]
init/Kconfig+1−0
@@ -1670,6 +1670,7 @@ config BASE_SMALL · 1669 unmodified lines
16701670
16711671 menuconfig MODULES
16721672 bool "Enable loadable module support"
1673+ option modules
16731674 help
16741675 Kernel modules are small pieces of compiled code which can
16751676 be inserted in the running kernel, rather than being
scripts/config+41−3
@@ -62,15 +62,52 @@ checkarg() { · 61 unmodified lines
6262 fi
6363 }
6464
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+
65100 set_var() {
66101 local name=$1 new=$2 before=$3
67102
68103 name_re="^($name=|# $name is not set)"
69104 before_re="^($before=|# $before is not set)"
70105 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"
72108 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"
74111 else
75112 echo "$new" >>"$FN"
76113 fi
@@ -79,7 +116,8 @@ set_var() { · 2 unmodified lines
79116 undef_var() {
80117 local name=$1
81118
82− sed -ri "/^($name=|# $name is not set)/d" "$FN"
119+ txt_delete "^$name=" "$FN"
120+ txt_delete "^# $name is not set" "$FN"
83121 }
84122
85123 if [ "$1" = "--file" ]; then
scripts/diffconfig+18−15
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010 import sys, os
1111
1212 def usage():
13− print """Usage: diffconfig [-h] [-m] [<config1> <config2>]
13+ print("""Usage: diffconfig [-h] [-m] [<config1> <config2>]
1414
1515 Diffconfig is a simple utility for comparing two .config files.
1616 Using standard diff to compare .config files often includes extraneous and
@@ -33,7 +33,7 @@ Example usage: · 16 unmodified lines
3333 EXT2_FS y -> n
3434 LOG_BUF_SHIFT 14 -> 16
3535 PRINTK_TIME n -> y
36−"""
36+""")
3737 sys.exit(0)
3838
3939 # 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): · 14 unmodified lines
5454 if merge_style:
5555 if new_value:
5656 if new_value=="n":
57− print "# CONFIG_%s is not set" % config
57+ print("# CONFIG_%s is not set" % config)
5858 else:
59− print "CONFIG_%s=%s" % (config, new_value)
59+ print("CONFIG_%s=%s" % (config, new_value))
6060 else:
6161 if op=="-":
62− print "-%s %s" % (config, value)
62+ print("-%s %s" % (config, value))
6363 elif op=="+":
64− print "+%s %s" % (config, new_value)
64+ print("+%s %s" % (config, new_value))
6565 else:
66− print " %s %s -> %s" % (config, value, new_value)
66+ print(" %s %s -> %s" % (config, value, new_value))
6767
6868 def main():
6969 global merge_style
7070
7171 # parse command line args
7272 if ("-h" in sys.argv or "--help" in sys.argv):
73− usage()
73+ usage()
7474
7575 merge_style = 0
7676 if "-m" in sys.argv:
@@ -79,23 +79,27 @@ def main(): · 2 unmodified lines
7979
8080 argc = len(sys.argv)
8181 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")
8383 usage()
8484
8585 if argc == 1:
8686 # if no filenames given, assume .config and .config.old
8787 build_dir=""
88− if os.environ.has_key("KBUILD_OUTPUT"):
88+ if "KBUILD_OUTPUT" in os.environ:
8989 build_dir = os.environ["KBUILD_OUTPUT"]+"/"
90−
9190 configa_filename = build_dir + ".config.old"
9291 configb_filename = build_dir + ".config"
9392 else:
9493 configa_filename = sys.argv[1]
9594 configb_filename = sys.argv[2]
9695
97− a = readconfig(file(configa_filename))
98− b = readconfig(file(configb_filename))
96+ try:
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()
99103
100104 # print items in a but not b (accumulate, sort and print)
101105 old = []
@@ -121,8 +125,7 @@ def main(): · 19 unmodified lines
121125
122126 # now print items in b but not in a
123127 # (items from b that were in a were removed above)
124− new = b.keys()
125− new.sort()
128+ new = sorted(b.keys())
126129 for config in new:
127130 print_config("+", config, None, b[config])
128131
scripts/kconfig/confdata.c+8−3
@@ -140,7 +140,9 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p) · 139 unmodified lines
140140 sym->flags |= def_flags;
141141 break;
142142 }
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);
144146 return 1;
145147 case S_OTHER:
146148 if (*p != '"') {
@@ -161,7 +163,8 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p) · 14 unmodified lines
161163 memmove(p2, p2 + 1, strlen(p2));
162164 }
163165 if (!p2) {
164− conf_warning("invalid string found");
166+ if (def != S_DEF_AUTO)
167+ conf_warning("invalid string found");
165168 return 1;
166169 }
167170 /* fall through */
@@ -172,7 +175,9 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p) · 4 unmodified lines
172175 sym->def[def].val = strdup(p);
173176 sym->flags |= def_flags;
174177 } 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);
176181 return 1;
177182 }
178183 break;
scripts/kconfig/mconf.c+2−2
@@ -401,8 +401,8 @@ static void search_conf(void) · 400 unmodified lines
401401 struct subtitle_part stpart;
402402
403403 title = str_new();
404− str_printf( &title, _("Enter %s (sub)string or regexp to search for "
405− "(with or without \"%s\")"), CONFIG_, CONFIG_);
404+ str_printf( &title, _("Enter (sub)string or regexp to search for "
405+ "(with or without \"%s\")"), CONFIG_);
406406
407407 again:
408408 dialog_clear();
scripts/kconfig/menu.c+7−4
@@ -197,12 +197,15 @@ void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep) · 196 unmodified lines
197197
198198 void menu_add_option(int token, char *arg)
199199 {
200− struct property *prop;
201−
202200 switch (token) {
203201 case T_OPT_MODULES:
204− prop = prop_alloc(P_DEFAULT, modules_sym);
205− prop->expr = expr_alloc_symbol(current_entry->sym);
202+ if (modules_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;
206209 break;
207210 case T_OPT_DEFCONFIG_LIST:
208211 if (!sym_defconfig_list)
scripts/kconfig/nconf.c+2−2
@@ -695,8 +695,8 @@ static void search_conf(void) · 694 unmodified lines
695695 int dres;
696696
697697 title = str_new();
698− str_printf( &title, _("Enter %s (sub)string or regexp to search for "
699− "(with or without \"%s\")"), CONFIG_, CONFIG_);
698+ str_printf( &title, _("Enter (sub)string or regexp to search for "
699+ "(with or without \"%s\")"), CONFIG_);
700700
701701 again:
702702 dres = dialog_inputbox(main_window,
scripts/kconfig/symbol.c+30−38
@@ -136,7 +136,7 @@ static struct property *sym_get_range_prop(struct symbol *sym) · 135 unmodified lines
136136 return NULL;
137137 }
138138
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)
140140 {
141141 sym_calc_value(sym);
142142 switch (sym->type) {
@@ -149,13 +149,14 @@ static long sym_get_range_val(struct symbol *sym, int base) · 6 unmodified lines
149149 default:
150150 break;
151151 }
152− return strtol(sym->curr.val, NULL, base);
152+ return strtoll(sym->curr.val, NULL, base);
153153 }
154154
155155 static void sym_validate_range(struct symbol *sym)
156156 {
157157 struct property *prop;
158− long base, val, val2;
158+ int base;
159+ long long val, val2;
159160 char str[64];
160161
161162 switch (sym->type) {
@@ -171,7 +172,7 @@ static void sym_validate_range(struct symbol *sym) · 9 unmodified lines
171172 prop = sym_get_range_prop(sym);
172173 if (!prop)
173174 return;
174− val = strtol(sym->curr.val, NULL, base);
175+ val = strtoll(sym->curr.val, NULL, base);
175176 val2 = sym_get_range_val(prop->expr->left.sym, base);
176177 if (val >= val2) {
177178 val2 = sym_get_range_val(prop->expr->right.sym, base);
@@ -179,9 +180,9 @@ static void sym_validate_range(struct symbol *sym) · 1 unmodified line
179180 return;
180181 }
181182 if (sym->type == S_INT)
182− sprintf(str, "%ld", val2);
183+ sprintf(str, "%lld", val2);
183184 else
184− sprintf(str, "0x%lx", val2);
185+ sprintf(str, "0x%llx", val2);
185186 sym->curr.val = strdup(str);
186187 }
187188
@@ -594,7 +595,7 @@ bool sym_string_valid(struct symbol *sym, const char *str) · 406 unmodified lines
594595 bool sym_string_within_range(struct symbol *sym, const char *str)
595596 {
596597 struct property *prop;
597− long val;
598+ long long val;
598599
599600 switch (sym->type) {
600601 case S_STRING:
@@ -605,7 +606,7 @@ bool sym_string_within_range(struct symbol *sym, const char *str) · 4 unmodified lines
605606 prop = sym_get_range_prop(sym);
606607 if (!prop)
607608 return true;
608− val = strtol(str, NULL, 10);
609+ val = strtoll(str, NULL, 10);
609610 return val >= sym_get_range_val(prop->expr->left.sym, 10) &&
610611 val <= sym_get_range_val(prop->expr->right.sym, 10);
611612 case S_HEX:
@@ -614,7 +615,7 @@ bool sym_string_within_range(struct symbol *sym, const char *str) · 2 unmodified lines
614615 prop = sym_get_range_prop(sym);
615616 if (!prop)
616617 return true;
617− val = strtol(str, NULL, 16);
618+ val = strtoll(str, NULL, 16);
618619 return val >= sym_get_range_val(prop->expr->left.sym, 16) &&
619620 val <= sym_get_range_val(prop->expr->right.sym, 16);
620621 case S_BOOLEAN:
@@ -963,11 +964,11 @@ struct sym_match { · 342 unmodified lines
963964 * - first, symbols that match exactly
964965 * - then, alphabetical sort
965966 */
966−static int sym_rel_comp( const void *sym1, const void *sym2 )
967+static int sym_rel_comp(const void *sym1, const void *sym2)
967968 {
968− struct sym_match *s1 = *(struct sym_match **)sym1;
969− struct sym_match *s2 = *(struct sym_match **)sym2;
970− int l1, l2;
969+ const struct sym_match *s1 = sym1;
970+ const struct sym_match *s2 = sym2;
971+ int exact1, exact2;
971972
972973 /* Exact match:
973974 * - 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 ) · 4 unmodified lines
978979 * exactly; if this is the case, we can't decide which comes first,
979980 * and we fallback to sorting alphabetically.
980981 */
981− l1 = s1->eo - s1->so;
982− l2 = s2->eo - s2->so;
983− if (l1 == strlen(s1->sym->name) && l2 != strlen(s2->sym->name))
982+ exact1 = (s1->eo - s1->so) == strlen(s1->sym->name);
983+ exact2 = (s2->eo - s2->so) == strlen(s2->sym->name);
984+ if (exact1 && !exact2)
984985 return -1;
985− if (l1 != strlen(s1->sym->name) && l2 == strlen(s2->sym->name))
986+ if (!exact1 && exact2)
986987 return 1;
987988
988989 /* As a fallback, sort symbols alphabetically */
@@ -992,7 +993,7 @@ static int sym_rel_comp( const void *sym1, const void *sym2 ) · 3 unmodified lines
992993 struct symbol **sym_re_search(const char *pattern)
993994 {
994995 struct symbol *sym, **sym_arr = NULL;
995− struct sym_match **sym_match_arr = NULL;
996+ struct sym_match *sym_match_arr = NULL;
996997 int i, cnt, size;
997998 regex_t re;
998999 regmatch_t match[1];
@@ -1005,47 +1006,38 @@ struct symbol **sym_re_search(const char *pattern) · 6 unmodified lines
10051006 return NULL;
10061007
10071008 for_all_symbols(i, sym) {
1008− struct sym_match *tmp_sym_match;
10091009 if (sym->flags & SYMBOL_CONST || !sym->name)
10101010 continue;
10111011 if (regexec(&re, sym->name, 1, match, 0))
10121012 continue;
1013− if (cnt + 1 >= size) {
1013+ if (cnt >= size) {
10141014 void *tmp;
10151015 size += 16;
1016− tmp = realloc(sym_match_arr, size * sizeof(struct sym_match *));
1017− if (!tmp) {
1016+ tmp = realloc(sym_match_arr, size * sizeof(struct sym_match));
1017+ if (!tmp)
10181018 goto sym_re_search_free;
1019− }
10201019 sym_match_arr = tmp;
10211020 }
10221021 sym_calc_value(sym);
1023− tmp_sym_match = (struct sym_match*)malloc(sizeof(struct sym_match));
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
1022+ /* As regexec returned 0, we know we have a match, so
10281023 * we can use match[0].rm_[se]o without further checks
10291024 */
1030− tmp_sym_match->so = match[0].rm_so;
1031− tmp_sym_match->eo = match[0].rm_eo;
1032− sym_match_arr[cnt++] = tmp_sym_match;
1025+ sym_match_arr[cnt].so = match[0].rm_so;
1026+ sym_match_arr[cnt].eo = match[0].rm_eo;
1027+ sym_match_arr[cnt++].sym = sym;
10331028 }
10341029 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);
10361031 sym_arr = malloc((cnt+1) * sizeof(struct symbol));
10371032 if (!sym_arr)
10381033 goto sym_re_search_free;
10391034 for (i = 0; i < cnt; i++)
1040− sym_arr[i] = sym_match_arr[i]->sym;
1035+ sym_arr[i] = sym_match_arr[i].sym;
10411036 sym_arr[cnt] = NULL;
10421037 }
10431038 sym_re_search_free:
1044− if (sym_match_arr) {
1045− for (i = 0; i < cnt; i++)
1046− free(sym_match_arr[i]);
1047− free(sym_match_arr);
1048− }
1039+ /* sym_match_arr can be NULL if no match, but free(NULL) is OK */
1040+ free(sym_match_arr);
10491041 regfree(&re);
10501042
10511043 return sym_arr;
scripts/kconfig/zconf.tab.c_shipped+298−264
@@ -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. */
22
3−/* Skeleton implementation for Bison's Yacc-like parsers in C
3+/* Bison implementation for Yacc-like parsers in C
44
5− Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
6− 2009, 2010 Free Software Foundation, Inc.
5+ Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
76
87 This program is free software: you can redistribute it and/or modify
98 it under the terms of the GNU General Public License as published by
@@ -45,7 +44,7 @@ · 35 unmodified lines
4544 #define YYBISON 1
4645
4746 /* Bison version. */
48−#define YYBISON_VERSION "2.4.3"
47+#define YYBISON_VERSION "2.5"
4948
5049 /* Skeleton name. */
5150 #define YYSKELETON_NAME "yacc.c"
@@ -302,11 +301,11 @@ YYID (yyi) · 250 unmodified lines
302301 # define alloca _alloca
303302 # else
304303 # 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__ \
306305 || defined __cplusplus || defined _MSC_VER)
307306 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
308−# ifndef _STDLIB_H
309−# define _STDLIB_H 1
307+# ifndef EXIT_SUCCESS
308+# define EXIT_SUCCESS 0
310309 # endif
311310 # endif
312311 # endif
@@ -329,24 +328,24 @@ YYID (yyi) · 16 unmodified lines
329328 # ifndef YYSTACK_ALLOC_MAXIMUM
330329 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
331330 # endif
332−# if (defined __cplusplus && ! defined _STDLIB_H \
331+# if (defined __cplusplus && ! defined EXIT_SUCCESS \
333332 && ! ((defined YYMALLOC || defined malloc) \
334333 && (defined YYFREE || defined free)))
335334 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
336−# ifndef _STDLIB_H
337−# define _STDLIB_H 1
335+# ifndef EXIT_SUCCESS
336+# define EXIT_SUCCESS 0
338337 # endif
339338 # endif
340339 # ifndef YYMALLOC
341340 # 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__ \
343342 || defined __cplusplus || defined _MSC_VER)
344343 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
345344 # endif
346345 # endif
347346 # ifndef YYFREE
348347 # 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__ \
350349 || defined __cplusplus || defined _MSC_VER)
351350 void free (void *); /* INFRINGES ON USER NAME SPACE */
352351 # endif
@@ -375,23 +374,7 @@ union yyalloc · 22 unmodified lines
375374 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
376375 + YYSTACK_GAP_MAXIMUM)
377376
378−/* Copy COUNT objects from FROM to TO. The source and destination do
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
377+# define YYCOPY_NEEDED 1
395378
396379 /* Relocate STACK from its old location to the new one. The
397380 local variables YYSIZE and YYSTACKSIZE give the old and new number of
@@ -411,6 +394,26 @@ union yyalloc · 13 unmodified lines
411394
412395 #endif
413396
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+
414417 /* YYFINAL -- State number of the termination state. */
415418 #define YYFINAL 11
416419 /* YYLAST -- Last index in YYTABLE. */
@@ -529,18 +532,18 @@ static const yytype_int8 yyrhs[] = · 112 unmodified lines
529532 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
530533 static const yytype_uint16 yyrline[] =
531534 {
532− 0, 104, 104, 104, 106, 106, 108, 110, 111, 112,
533− 113, 114, 115, 119, 123, 123, 123, 123, 123, 123,
534− 123, 123, 127, 128, 129, 130, 131, 132, 136, 137,
535− 143, 151, 157, 165, 175, 177, 178, 179, 180, 181,
536− 182, 185, 193, 199, 209, 215, 221, 224, 226, 237,
537− 238, 243, 252, 257, 265, 268, 270, 271, 272, 273,
538− 274, 277, 283, 294, 300, 310, 312, 317, 325, 333,
539− 336, 338, 339, 340, 345, 352, 359, 364, 372, 375,
540− 377, 378, 379, 382, 390, 397, 404, 410, 417, 419,
541− 420, 421, 424, 432, 434, 435, 438, 445, 447, 452,
542− 453, 456, 457, 458, 462, 463, 466, 467, 470, 471,
543− 472, 473, 474, 475, 476, 479, 480, 483, 484
535+ 0, 103, 103, 103, 105, 105, 107, 109, 110, 111,
536+ 112, 113, 114, 118, 122, 122, 122, 122, 122, 122,
537+ 122, 122, 126, 127, 128, 129, 130, 131, 135, 136,
538+ 142, 150, 156, 164, 174, 176, 177, 178, 179, 180,
539+ 181, 184, 192, 198, 208, 214, 220, 223, 225, 236,
540+ 237, 242, 251, 256, 264, 267, 269, 270, 271, 272,
541+ 273, 276, 282, 293, 299, 309, 311, 316, 324, 332,
542+ 335, 337, 338, 339, 344, 351, 358, 363, 371, 374,
543+ 376, 377, 378, 381, 389, 396, 403, 409, 416, 418,
544+ 419, 420, 423, 431, 433, 434, 437, 444, 446, 451,
545+ 452, 455, 456, 457, 461, 462, 465, 466, 469, 470,
546+ 471, 472, 473, 474, 475, 478, 479, 482, 483
544547 };
545548 #endif
546549
@@ -615,8 +618,8 @@ static const yytype_uint8 yyr2[] = · 68 unmodified lines
615618 3, 3, 2, 3, 3, 1, 1, 0, 1
616619 };
617620
618−/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
619− STATE-NUM when YYTABLE doesn't specify something else to do. Zero
621+/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
622+ Performed when YYTABLE doesn't specify something else to do. Zero
620623 means the default is an error. */
621624 static const yytype_uint8 yydefact[] =
622625 {
@@ -691,8 +694,7 @@ static const yytype_int16 yypgoto[] = · 68 unmodified lines
691694
692695 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
693696 positive, shift that token. If negative, reduce the rule which
694− number is the opposite. If zero, do what YYDEFACT says.
695− If YYTABLE_NINF, syntax error. */
697+ number is the opposite. If YYTABLE_NINF, syntax error. */
696698 #define YYTABLE_NINF -86
697699 static const yytype_int16 yytable[] =
698700 {
@@ -728,6 +730,12 @@ static const yytype_int16 yytable[] = · 29 unmodified lines
728730 184
729731 };
730732
733+#define yypact_value_is_default(yystate) \
734+ ((yystate) == (-90))
735+
736+#define yytable_value_is_error(yytable_value) \
737+ YYID (0)
738+
731739 static const yytype_int16 yycheck[] =
732740 {
733741 1, 67, 68, 10, 93, 94, 76, 3, 76, 14,
@@ -821,7 +829,6 @@ do \ · 87 unmodified lines
821829 { \
822830 yychar = (Token); \
823831 yylval = (Value); \
824− yytoken = YYTRANSLATE (yychar); \
825832 YYPOPSTACK (1); \
826833 goto yybackup; \
827834 } \
@@ -863,19 +870,10 @@ while (YYID (0)) · 35 unmodified lines
863870 #endif
864871
865872
866−/* YY_LOCATION_PRINT -- Print the location on the stream.
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. */
873+/* This macro is provided for backward compatibility. */
869874
870875 #ifndef YY_LOCATION_PRINT
871−# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
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
876+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
879877 #endif
880878
881879
@@ -1067,7 +1065,6 @@ int yydebug; · 185 unmodified lines
10671065 # define YYMAXDEPTH 10000
10681066 #endif
10691067
1070−
10711068
10721069 #if YYERROR_VERBOSE
10731070
@@ -1170,115 +1167,142 @@ yytnamerr (char *yyres, const char *yystr) · 96 unmodified lines
11701167 }
11711168 # endif
11721169
1173−/* Copy into YYRESULT an error message about the unexpected token
1174− YYCHAR while in state YYSTATE. Return the number of bytes copied,
1175− including the terminating null byte. If YYRESULT is null, do not
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];
1170+/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1171+ about the unexpected token YYTOKEN for the state stack whose top is
1172+ YYSSP.
11841173
1185− if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1186− return 0;
1187− else
1174+ Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1175+ not large enough to hold the message. In that case, also set
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)
11881222 {
1189− int yytype = YYTRANSLATE (yychar);
1190− YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1191− YYSIZE_T yysize = yysize0;
1192− YYSIZE_T yysize1;
1193− int yysize_overflow = 0;
1194− enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1195− char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1196− int yyx;
1197−
1198−# if 0
1199− /* This is so xgettext sees the translatable formats that are
1200− constructed on the fly. */
1201− YY_("syntax error, unexpected %s");
1202− YY_("syntax error, unexpected %s, expecting %s");
1203− YY_("syntax error, unexpected %s, expecting %s or %s");
1204− YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1205− YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1206−# endif
1207− char *yyfmt;
1208− char const *yyf;
1209− static char const yyunexpected[] = "syntax error, unexpected %s";
1210− static char const yyexpecting[] = ", expecting %s";
1211− static char const yyor[] = " or %s";
1212− char yyformat[sizeof yyunexpected
1213− + sizeof yyexpecting - 1
1214− + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1215− * (sizeof yyor - 1))];
1216− char const *yyprefix = yyexpecting;
1217−
1218− /* Start YYX at -YYN if negative to avoid negative indexes in
1219− YYCHECK. */
1220− int yyxbegin = yyn < 0 ? -yyn : 0;
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− }
1223+ int yyn = yypact[*yyssp];
1224+ yyarg[yycount++] = yytname[yytoken];
1225+ if (!yypact_value_is_default (yyn))
1226+ {
1227+ /* Start YYX at -YYN if negative to avoid negative indexes in
1228+ YYCHECK. In other words, skip the first -YYN actions for
1229+ this state because they are default actions. */
1230+ int yyxbegin = yyn < 0 ? -yyn : 0;
1231+ /* Stay within bounds of both yycheck and yytname. */
1232+ int yychecklim = YYLAST - yyn + 1;
1233+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1234+ int yyx;
1235+
1236+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1237+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1238+ && !yytable_value_is_error (yytable[yyx + yyn]))
1239+ {
1240+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1241+ {
1242+ yycount = 1;
1243+ yysize = yysize0;
1244+ break;
1245+ }
1246+ yyarg[yycount++] = yytname[yyx];
1247+ yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1248+ if (! (yysize <= yysize1
1249+ && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1250+ return 2;
1251+ yysize = yysize1;
1252+ }
1253+ }
1254+ }
12471255
1248− yyf = YY_(yyformat);
1249− yysize1 = yysize + yystrlen (yyf);
1250− yysize_overflow |= (yysize1 < yysize);
1251− yysize = yysize1;
1256+ switch (yycount)
1257+ {
1258+# define YYCASE_(N, S) \
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+ }
12521270
1253− if (yysize_overflow)
1254− return YYSIZE_MAXIMUM;
1271+ yysize1 = yysize + yystrlen (yyformat);
1272+ if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1273+ return 2;
1274+ yysize = yysize1;
12551275
1256− if (yyresult)
1257− {
1258− /* Avoid sprintf, as that infringes on the user's name space.
1259− Don't have undefined behavior even if the translation
1260− produced a string with the wrong number of "%s"s. */
1261− char *yyp = yyresult;
1262− int yyi = 0;
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;
1276+ if (*yymsg_alloc < yysize)
1277+ {
1278+ *yymsg_alloc = 2 * yysize;
1279+ if (! (yysize <= *yymsg_alloc
1280+ && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1281+ *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1282+ return 1;
12781283 }
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;
12791304 }
12801305 #endif /* YYERROR_VERBOSE */
1281−
12821306
12831307 /*-----------------------------------------------.
12841308 | Release the memory associated to this symbol. |
@@ -1341,6 +1365,7 @@ yydestruct (yymsg, yytype, yyvaluep) · 56 unmodified lines
13411365 }
13421366 }
13431367
1368+
13441369 /* Prevent warnings from -Wmissing-prototypes. */
13451370 #ifdef YYPARSE_PARAM
13461371 #if defined __STDC__ || defined __cplusplus
@@ -1367,10 +1392,9 @@ YYSTYPE yylval; · 20 unmodified lines
13671392 int yynerrs;
13681393
13691394
1370−
1371−/*-------------------------.
1372−| yyparse or yypush_parse. |
1373−`-------------------------*/
1395+/*----------.
1396+| yyparse. |
1397+`----------*/
13741398
13751399 #ifdef YYPARSE_PARAM
13761400 #if (defined __STDC__ || defined __C99__FUNC__ \
@@ -1394,8 +1418,6 @@ yyparse () · 17 unmodified lines
13941418 #endif
13951419 #endif
13961420 {
1397−
1398−
13991421 int yystate;
14001422 /* Number of tokens to shift before error messages enabled. */
14011423 int yyerrstatus;
@@ -1550,7 +1572,7 @@ yybackup: · 148 unmodified lines
15501572
15511573 /* First try to decide what to do without reference to lookahead token. */
15521574 yyn = yypact[yystate];
1553− if (yyn == YYPACT_NINF)
1575+ if (yypact_value_is_default (yyn))
15541576 goto yydefault;
15551577
15561578 /* Not known => get a lookahead token if don't already have one. */
@@ -1581,8 +1603,8 @@ yybackup: · 24 unmodified lines
15811603 yyn = yytable[yyn];
15821604 if (yyn <= 0)
15831605 {
1584− if (yyn == 0 || yyn == YYTABLE_NINF)
1585− goto yyerrlab;
1606+ if (yytable_value_is_error (yyn))
1607+ goto yyerrlab;
15861608 yyn = -yyn;
15871609 goto yyreduce;
15881610 }
@@ -1637,34 +1659,34 @@ yyreduce: · 48 unmodified lines
16371659 {
16381660 case 10:
16391661
1640− { zconf_error("unexpected end statement"); ;}
1662+ { zconf_error("unexpected end statement"); }
16411663 break;
16421664
16431665 case 11:
16441666
1645− { zconf_error("unknown statement \"%s\"", (yyvsp[(2) - (4)].string)); ;}
1667+ { zconf_error("unknown statement \"%s\"", (yyvsp[(2) - (4)].string)); }
16461668 break;
16471669
16481670 case 12:
16491671
16501672 {
16511673 zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[(2) - (4)].id)->name);
1652−;}
1674+}
16531675 break;
16541676
16551677 case 13:
16561678
1657− { zconf_error("invalid statement"); ;}
1679+ { zconf_error("invalid statement"); }
16581680 break;
16591681
16601682 case 28:
16611683
1662− { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); ;}
1684+ { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); }
16631685 break;
16641686
16651687 case 29:
16661688
1667− { zconf_error("invalid option"); ;}
1689+ { zconf_error("invalid option"); }
16681690 break;
16691691
16701692 case 30:
@@ -1674,7 +1696,7 @@ yyreduce: · 3 unmodified lines
16741696 sym->flags |= SYMBOL_OPTIONAL;
16751697 menu_add_entry(sym);
16761698 printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
1677−;}
1699+}
16781700 break;
16791701
16801702 case 31:
@@ -1682,7 +1704,7 @@ yyreduce: · 1 unmodified line
16821704 {
16831705 menu_end_entry();
16841706 printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1685−;}
1707+}
16861708 break;
16871709
16881710 case 32:
@@ -1692,7 +1714,7 @@ yyreduce: · 3 unmodified lines
16921714 sym->flags |= SYMBOL_OPTIONAL;
16931715 menu_add_entry(sym);
16941716 printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
1695−;}
1717+}
16961718 break;
16971719
16981720 case 33:
@@ -1704,7 +1726,7 @@ yyreduce: · 5 unmodified lines
17041726 zconfprint("warning: menuconfig statement without prompt");
17051727 menu_end_entry();
17061728 printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1707−;}
1729+}
17081730 break;
17091731
17101732 case 41:
@@ -1714,7 +1736,7 @@ yyreduce: · 3 unmodified lines
17141736 printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
17151737 zconf_curname(), zconf_lineno(),
17161738 (yyvsp[(1) - (3)].id)->stype);
1717−;}
1739+}
17181740 break;
17191741
17201742 case 42:
@@ -1722,7 +1744,7 @@ yyreduce: · 1 unmodified line
17221744 {
17231745 menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
17241746 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1725−;}
1747+}
17261748 break;
17271749
17281750 case 43:
@@ -1734,7 +1756,7 @@ yyreduce: · 5 unmodified lines
17341756 printd(DEBUG_PARSE, "%s:%d:default(%u)\n",
17351757 zconf_curname(), zconf_lineno(),
17361758 (yyvsp[(1) - (4)].id)->stype);
1737−;}
1759+}
17381760 break;
17391761
17401762 case 44:
@@ -1742,7 +1764,7 @@ yyreduce: · 1 unmodified line
17421764 {
17431765 menu_add_symbol(P_SELECT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
17441766 printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
1745−;}
1767+}
17461768 break;
17471769
17481770 case 45:
@@ -1750,7 +1772,7 @@ yyreduce: · 1 unmodified line
17501772 {
17511773 menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[(2) - (5)].symbol), (yyvsp[(3) - (5)].symbol)), (yyvsp[(4) - (5)].expr));
17521774 printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
1753−;}
1775+}
17541776 break;
17551777
17561778 case 48:
@@ -1762,17 +1784,17 @@ yyreduce: · 5 unmodified lines
17621784 else
17631785 zconfprint("warning: ignoring unknown option %s", (yyvsp[(2) - (3)].string));
17641786 free((yyvsp[(2) - (3)].string));
1765−;}
1787+}
17661788 break;
17671789
17681790 case 49:
17691791
1770− { (yyval.string) = NULL; ;}
1792+ { (yyval.string) = NULL; }
17711793 break;
17721794
17731795 case 50:
17741796
1775− { (yyval.string) = (yyvsp[(2) - (2)].string); ;}
1797+ { (yyval.string) = (yyvsp[(2) - (2)].string); }
17761798 break;
17771799
17781800 case 51:
@@ -1783,14 +1805,14 @@ yyreduce: · 4 unmodified lines
17831805 menu_add_entry(sym);
17841806 menu_add_expr(P_CHOICE, NULL, NULL);
17851807 printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
1786−;}
1808+}
17871809 break;
17881810
17891811 case 52:
17901812
17911813 {
17921814 (yyval.menu) = menu_add_menu();
1793−;}
1815+}
17941816 break;
17951817
17961818 case 53:
@@ -1800,7 +1822,7 @@ yyreduce: · 3 unmodified lines
18001822 menu_end_menu();
18011823 printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
18021824 }
1803−;}
1825+}
18041826 break;
18051827
18061828 case 61:
@@ -1808,7 +1830,7 @@ yyreduce: · 1 unmodified line
18081830 {
18091831 menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
18101832 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1811−;}
1833+}
18121834 break;
18131835
18141836 case 62:
@@ -1821,7 +1843,7 @@ yyreduce: · 6 unmodified lines
18211843 (yyvsp[(1) - (3)].id)->stype);
18221844 } else
18231845 YYERROR;
1824−;}
1846+}
18251847 break;
18261848
18271849 case 63:
@@ -1829,7 +1851,7 @@ yyreduce: · 1 unmodified line
18291851 {
18301852 current_entry->sym->flags |= SYMBOL_OPTIONAL;
18311853 printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
1832−;}
1854+}
18331855 break;
18341856
18351857 case 64:
@@ -1841,7 +1863,7 @@ yyreduce: · 5 unmodified lines
18411863 zconf_curname(), zconf_lineno());
18421864 } else
18431865 YYERROR;
1844−;}
1866+}
18451867 break;
18461868
18471869 case 67:
@@ -1851,7 +1873,7 @@ yyreduce: · 3 unmodified lines
18511873 menu_add_entry(NULL);
18521874 menu_add_dep((yyvsp[(2) - (3)].expr));
18531875 (yyval.menu) = menu_add_menu();
1854−;}
1876+}
18551877 break;
18561878
18571879 case 68:
@@ -1861,14 +1883,14 @@ yyreduce: · 3 unmodified lines
18611883 menu_end_menu();
18621884 printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
18631885 }
1864−;}
1886+}
18651887 break;
18661888
18671889 case 74:
18681890
18691891 {
18701892 menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
1871−;}
1893+}
18721894 break;
18731895
18741896 case 75:
@@ -1877,14 +1899,14 @@ yyreduce: · 2 unmodified lines
18771899 menu_add_entry(NULL);
18781900 menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
18791901 printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
1880−;}
1902+}
18811903 break;
18821904
18831905 case 76:
18841906
18851907 {
18861908 (yyval.menu) = menu_add_menu();
1887−;}
1909+}
18881910 break;
18891911
18901912 case 77:
@@ -1894,7 +1916,7 @@ yyreduce: · 3 unmodified lines
18941916 menu_end_menu();
18951917 printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());
18961918 }
1897−;}
1919+}
18981920 break;
18991921
19001922 case 83:
@@ -1902,7 +1924,7 @@ yyreduce: · 1 unmodified line
19021924 {
19031925 printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
19041926 zconf_nextfile((yyvsp[(2) - (3)].string));
1905−;}
1927+}
19061928 break;
19071929
19081930 case 84:
@@ -1911,14 +1933,14 @@ yyreduce: · 2 unmodified lines
19111933 menu_add_entry(NULL);
19121934 menu_add_prompt(P_COMMENT, (yyvsp[(2) - (3)].string), NULL);
19131935 printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
1914−;}
1936+}
19151937 break;
19161938
19171939 case 85:
19181940
19191941 {
19201942 menu_end_entry();
1921−;}
1943+}
19221944 break;
19231945
19241946 case 86:
@@ -1926,14 +1948,14 @@ yyreduce: · 1 unmodified line
19261948 {
19271949 printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
19281950 zconf_starthelp();
1929−;}
1951+}
19301952 break;
19311953
19321954 case 87:
19331955
19341956 {
19351957 current_entry->help = (yyvsp[(2) - (2)].string);
1936−;}
1958+}
19371959 break;
19381960
19391961 case 92:
@@ -1941,102 +1963,113 @@ yyreduce: · 1 unmodified line
19411963 {
19421964 menu_add_dep((yyvsp[(3) - (4)].expr));
19431965 printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
1944−;}
1966+}
19451967 break;
19461968
19471969 case 96:
19481970
19491971 {
19501972 menu_add_visibility((yyvsp[(2) - (2)].expr));
1951−;}
1973+}
19521974 break;
19531975
19541976 case 98:
19551977
19561978 {
19571979 menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr));
1958−;}
1980+}
19591981 break;
19601982
19611983 case 101:
19621984
1963− { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
1985+ { (yyval.id) = (yyvsp[(1) - (2)].id); }
19641986 break;
19651987
19661988 case 102:
19671989
1968− { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
1990+ { (yyval.id) = (yyvsp[(1) - (2)].id); }
19691991 break;
19701992
19711993 case 103:
19721994
1973− { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
1995+ { (yyval.id) = (yyvsp[(1) - (2)].id); }
19741996 break;
19751997
19761998 case 106:
19771999
1978− { (yyval.expr) = NULL; ;}
2000+ { (yyval.expr) = NULL; }
19792001 break;
19802002
19812003 case 107:
19822004
1983− { (yyval.expr) = (yyvsp[(2) - (2)].expr); ;}
2005+ { (yyval.expr) = (yyvsp[(2) - (2)].expr); }
19842006 break;
19852007
19862008 case 108:
19872009
1988− { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); ;}
2010+ { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); }
19892011 break;
19902012
19912013 case 109:
19922014
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)); }
19942016 break;
19952017
19962018 case 110:
19972019
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)); }
19992021 break;
20002022
20012023 case 111:
20022024
2003− { (yyval.expr) = (yyvsp[(2) - (3)].expr); ;}
2025+ { (yyval.expr) = (yyvsp[(2) - (3)].expr); }
20042026 break;
20052027
20062028 case 112:
20072029
2008− { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); ;}
2030+ { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); }
20092031 break;
20102032
20112033 case 113:
20122034
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)); }
20142036 break;
20152037
20162038 case 114:
20172039
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)); }
20192041 break;
20202042
20212043 case 115:
20222044
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)); }
20242046 break;
20252047
20262048 case 116:
20272049
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)); }
20292051 break;
20302052
20312053 case 117:
20322054
2033− { (yyval.string) = NULL; ;}
2055+ { (yyval.string) = NULL; }
20342056 break;
20352057
20362058
20372059
20382060 default: break;
20392061 }
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. */
20402073 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
20412074
20422075 YYPOPSTACK (yylen);
@@ -2064,6 +2097,10 @@ yyreduce: · 21 unmodified lines
20642097 | yyerrlab -- here on detecting error |
20652098 `------------------------------------*/
20662099 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+
20672104 /* If not already recovering from an error, report this error. */
20682105 if (!yyerrstatus)
20692106 {
@@ -2071,37 +2108,36 @@ yyerrlab: · 1 unmodified line
20712108 #if ! YYERROR_VERBOSE
20722109 yyerror (YY_("syntax error"));
20732110 #else
2111+# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2112+ yyssp, yytoken)
20742113 {
2075− YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2076− if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2077− {
2078− YYSIZE_T yyalloc = 2 * yysize;
2079− if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2080− yyalloc = YYSTACK_ALLOC_MAXIMUM;
2081− if (yymsg != yymsgbuf)
2082− YYSTACK_FREE (yymsg);
2083− yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2084− if (yymsg)
2085− yymsg_alloc = yyalloc;
2086− else
2087− {
2088− yymsg = yymsgbuf;
2089− yymsg_alloc = sizeof yymsgbuf;
2090− }
2091− }
2092−
2093− if (0 < yysize && yysize <= yymsg_alloc)
2094− {
2095− (void) yysyntax_error (yymsg, yystate, yychar);
2096− yyerror (yymsg);
2097− }
2098− else
2099− {
2100− yyerror (YY_("syntax error"));
2101− if (yysize != 0)
2102− goto yyexhaustedlab;
2103− }
2114+ char const *yymsgp = YY_("syntax error");
2115+ int yysyntax_error_status;
2116+ yysyntax_error_status = YYSYNTAX_ERROR;
2117+ if (yysyntax_error_status == 0)
2118+ yymsgp = yymsg;
2119+ else if (yysyntax_error_status == 1)
2120+ {
2121+ if (yymsg != yymsgbuf)
2122+ YYSTACK_FREE (yymsg);
2123+ yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2124+ if (!yymsg)
2125+ {
2126+ yymsg = yymsgbuf;
2127+ yymsg_alloc = sizeof yymsgbuf;
2128+ yysyntax_error_status = 2;
2129+ }
2130+ else
2131+ {
2132+ yysyntax_error_status = YYSYNTAX_ERROR;
2133+ yymsgp = yymsg;
2134+ }
2135+ }
2136+ yyerror (yymsgp);
2137+ if (yysyntax_error_status == 2)
2138+ goto yyexhaustedlab;
21042139 }
2140+# undef YYSYNTAX_ERROR
21052141 #endif
21062142 }
21072143
@@ -2160,7 +2196,7 @@ yyerrlab1: · 52 unmodified lines
21602196 for (;;)
21612197 {
21622198 yyn = yypact[yystate];
2163− if (yyn != YYPACT_NINF)
2199+ if (!yypact_value_is_default (yyn))
21642200 {
21652201 yyn += YYTERROR;
21662202 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
@@ -2219,8 +2255,13 @@ yyexhaustedlab: · 52 unmodified lines
22192255
22202256 yyreturn:
22212257 if (yychar != YYEMPTY)
2222− yydestruct ("Cleanup: discarding lookahead",
2223− yytoken, &yylval);
2258+ {
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+ }
22242265 /* Do not reclaim the symbols of the rule which action triggered
22252266 this YYABORT or YYACCEPT. */
22262267 YYPOPSTACK (yylen);
@@ -2256,9 +2297,6 @@ void conf_parse(const char *name) · 29 unmodified lines
22562297
22572298 sym_init();
22582299 _menu_init();
2259− modules_sym = sym_lookup(NULL, 0);
2260− modules_sym->type = S_BOOLEAN;
2261− modules_sym->flags |= SYMBOL_AUTO;
22622300 rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
22632301
22642302 if (getenv("ZCONF_DEBUG"))
@@ -2266,12 +2304,8 @@ void conf_parse(const char *name) · 1 unmodified line
22662304 zconfparse();
22672305 if (zconfnerrs)
22682306 exit(1);
2269− if (!modules_sym->prop) {
2270− struct property *prop;
2271−
2272− prop = prop_alloc(P_DEFAULT, modules_sym);
2273− prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0));
2274− }
2307+ if (!modules_sym)
2308+ modules_sym = sym_find( "n" );
22752309
22762310 rootmenu.prompt->text = _(rootmenu.prompt->text);
22772311 rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text);
scripts/kconfig/zconf.y+2−9
@@ -493,9 +493,6 @@ void conf_parse(const char *name) · 492 unmodified lines
493493
494494 sym_init();
495495 _menu_init();
496− modules_sym = sym_lookup(NULL, 0);
497− modules_sym->type = S_BOOLEAN;
498− modules_sym->flags |= SYMBOL_AUTO;
499496 rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
500497
501498 if (getenv("ZCONF_DEBUG"))
@@ -503,12 +500,8 @@ void conf_parse(const char *name) · 1 unmodified line
503500 zconfparse();
504501 if (zconfnerrs)
505502 exit(1);
506− if (!modules_sym->prop) {
507− struct property *prop;
508−
509− prop = prop_alloc(P_DEFAULT, modules_sym);
510− prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0));
511− }
503+ if (!modules_sym)
504+ modules_sym = sym_find( "n" );
512505
513506 rootmenu.prompt->text = _(rootmenu.prompt->text);
514507 rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text);