History

Merge branch 'master' into for-next

Sync with Linus tree to have 157550ff ("mtd: add GPMI-NAND driver in the config and Makefile") as I have patch depending on that one.

Jiri Kosina committed 15 years ago

Commit 2290c0d2 parents 4da669a 52e4c2a10515 files · +592882 −375993Browse files

Showing the changes to scripts (24 of 10515 files). Show all

Unified · Split

24 files
  1. scripts/Makefile.build +1 −1
  2. scripts/Makefile.lib +4 −0
  3. scripts/basic/fixdep.c +1 −0
  4. scripts/checkpatch.pl +43 −7
  5. scripts/extract-vmlinux +62 −0
  6. scripts/genksyms/genksyms.c +2 −1
  7. scripts/genksyms/genksyms.h +3 −1
  8. scripts/genksyms/lex.l +8 −0
  9. scripts/genksyms/lex.lex.c_shipped +10 −2
  10. scripts/genksyms/parse.tab.c_shipped +345 −300
  11. scripts/genksyms/parse.tab.h_shipped +3 −4
  12. scripts/genksyms/parse.y +22 −18
  13. scripts/kconfig/Makefile +2 −26
  14. scripts/kconfig/confdata.c +36 −13
  15. scripts/kconfig/lxdialog/textbox.c +1 −2
  16. scripts/kconfig/mconf.c +52 −34
  17. scripts/kconfig/menu.c +5 −8
  18. scripts/kconfig/nconf.c +10 −13
  19. scripts/kconfig/nconf.gui.c +47 −12
  20. scripts/kconfig/nconf.h +1 −1
  21. scripts/kconfig/streamline_config.pl +19 −3
  22. scripts/mod/file2alias.c +25 −0
  23. scripts/mod/modpost.c +7 −0
  24. scripts/tags.sh +2 −2
scripts/Makefile.build+1−1
@@ -46,7 +46,7 @@ include $(kbuild-file) · 45 unmodified lines
4646 # If the save-* variables changed error out
4747 ifeq ($(KBUILD_NOPEDANTIC),)
4848 ifneq ("$(save-cflags)","$(CFLAGS)")
49− $(error CFLAGS was changed in "$(kbuild-file)". Fix it to use EXTRA_CFLAGS)
49+ $(error CFLAGS was changed in "$(kbuild-file)". Fix it to use ccflags-y)
5050 endif
5151 endif
5252
scripts/Makefile.lib+4−0
@@ -167,6 +167,7 @@ ifdef REGENERATE_PARSERS · 166 unmodified lines
167167 quiet_cmd_gperf = GPERF $@
168168 cmd_gperf = gperf -t --output-file $@ -a -C -E -g -k 1,3,$$ -p -t $<
169169
170+.PRECIOUS: $(src)/%.hash.c_shipped
170171 $(src)/%.hash.c_shipped: $(src)/%.gperf
171172 $(call cmd,gperf)
172173
@@ -177,6 +178,7 @@ LEX_PREFIX = $(if $(LEX_PREFIX_${baseprereq}),$(LEX_PREFIX_${baseprereq}),yy) · 4 unmodified lines
177178 quiet_cmd_flex = LEX $@
178179 cmd_flex = flex -o$@ -L -P $(LEX_PREFIX) $<
179180
181+.PRECIOUS: $(src)/%.lex.c_shipped
180182 $(src)/%.lex.c_shipped: $(src)/%.l
181183 $(call cmd,flex)
182184
@@ -187,12 +189,14 @@ YACC_PREFIX = $(if $(YACC_PREFIX_${baseprereq}),$(YACC_PREFIX_${baseprereq}),yy) · 4 unmodified lines
187189 quiet_cmd_bison = YACC $@
188190 cmd_bison = bison -o$@ -t -l -p $(YACC_PREFIX) $<
189191
192+.PRECIOUS: $(src)/%.tab.c_shipped
190193 $(src)/%.tab.c_shipped: $(src)/%.y
191194 $(call cmd,bison)
192195
193196 quiet_cmd_bison_h = YACC $@
194197 cmd_bison_h = bison -o/dev/null --defines=$@ -t -l -p $(YACC_PREFIX) $<
195198
199+.PRECIOUS: $(src)/%.tab.h_shipped
196200 $(src)/%.tab.h_shipped: $(src)/%.y
197201 $(call cmd,bison_h)
198202
scripts/basic/fixdep.c+1−0
@@ -345,6 +345,7 @@ static void parse_dep_file(void *map, size_t len) · 344 unmodified lines
345345 memcpy(s, m, p-m); s[p-m] = 0;
346346 if (strrcmp(s, "include/generated/autoconf.h") &&
347347 strrcmp(s, "arch/um/include/uml-config.h") &&
348+ strrcmp(s, "include/linux/kconfig.h") &&
348349 strrcmp(s, ".ver")) {
349350 /*
350351 * Do not list the source file as dependency, so that
scripts/checkpatch.pl+43−7
@@ -240,9 +240,8 @@ our $NonptrType; · 239 unmodified lines
240240 our $Type;
241241 our $Declare;
242242
243−our $UTF8 = qr {
244− [\x09\x0A\x0D\x20-\x7E] # ASCII
245− | [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte
243+our $NON_ASCII_UTF8 = qr{
244+ [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte
246245 | \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs
247246 | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte
248247 | \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates
@@ -251,6 +250,11 @@ our $UTF8 = qr { · 2 unmodified lines
251250 | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16
252251 }x;
253252
253+our $UTF8 = qr{
254+ [\x09\x0A\x0D\x20-\x7E] # ASCII
255+ | $NON_ASCII_UTF8
256+}x;
257+
254258 our $typeTypedefs = qr{(?x:
255259 (?:__)?(?:u|s|be|le)(?:8|16|32|64)|
256260 atomic_t
@@ -1330,6 +1334,9 @@ sub process { · 1073 unmodified lines
13301334 my $signoff = 0;
13311335 my $is_patch = 0;
13321336
1337+ my $in_header_lines = 1;
1338+ my $in_commit_log = 0; #Scanning lines before patch
1339+
13331340 our @report = ();
13341341 our $cnt_lines = 0;
13351342 our $cnt_error = 0;
@@ -1497,7 +1504,6 @@ sub process { · 161 unmodified lines
14971504 if ($line =~ /^diff --git.*?(\S+)$/) {
14981505 $realfile = $1;
14991506 $realfile =~ s@^([^/]*)/@@;
1500−
15011507 } elsif ($line =~ /^\+\+\+\s+(\S+)/) {
15021508 $realfile = $1;
15031509 $realfile =~ s@^([^/]*)/@@;
@@ -1536,6 +1542,7 @@ sub process { · 32 unmodified lines
15361542 # Check the patch for a signoff:
15371543 if ($line =~ /^\s*signed-off-by:/i) {
15381544 $signoff++;
1545+ $in_commit_log = 0;
15391546 }
15401547
15411548 # Check signature styles
@@ -1613,6 +1620,21 @@ sub process { · 71 unmodified lines
16131620 "Invalid UTF-8, patch and commit message should be encoded in UTF-8\n" . $hereptr);
16141621 }
16151622
1623+# Check if it's the start of a commit log
1624+# (not a header line and we haven't seen the patch filename)
1625+ if ($in_header_lines && $realfile =~ /^$/ &&
1626+ $rawline !~ /^(commit\b|from\b|\w+:).+$/i) {
1627+ $in_header_lines = 0;
1628+ $in_commit_log = 1;
1629+ }
1630+
1631+# Still not yet in a patch, check for any UTF-8
1632+ if ($in_commit_log && $realfile =~ /^$/ &&
1633+ $rawline =~ /$NON_ASCII_UTF8/) {
1634+ CHK("UTF8_BEFORE_PATCH",
1635+ "8-bit UTF-8 used in possible commit log\n" . $herecurr);
1636+ }
1637+
16161638 # ignore non-hunk lines and lines being removed
16171639 next if (!$hunk_line || $line =~ /^-/);
16181640
@@ -1661,6 +1683,20 @@ sub process { · 42 unmodified lines
16611683 #print "is_end<$is_end> length<$length>\n";
16621684 }
16631685
1686+ if (($realfile =~ /Makefile.*/ || $realfile =~ /Kbuild.*/) &&
1687+ ($line =~ /\+(EXTRA_[A-Z]+FLAGS).*/)) {
1688+ my $flag = $1;
1689+ my $replacement = {
1690+ 'EXTRA_AFLAGS' => 'asflags-y',
1691+ 'EXTRA_CFLAGS' => 'ccflags-y',
1692+ 'EXTRA_CPPFLAGS' => 'cppflags-y',
1693+ 'EXTRA_LDFLAGS' => 'ldflags-y',
1694+ };
1695+
1696+ WARN("DEPRECATED_VARIABLE",
1697+ "Use of $flag is deprecated, please use \`$replacement->{$flag} instead.\n" . $herecurr) if ($replacement->{$flag});
1698+ }
1699+
16641700 # check we are in a valid source file if not then ignore this hunk
16651701 next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/);
16661702
@@ -3151,10 +3187,10 @@ sub process { · 1484 unmodified lines
31513187 "consider using a completion\n" . $herecurr);
31523188
31533189 }
3154−# recommend kstrto* over simple_strto*
3155− if ($line =~ /\bsimple_(strto.*?)\s*\(/) {
3190+# recommend kstrto* over simple_strto* and strict_strto*
3191+ if ($line =~ /\b((simple|strict)_(strto(l|ll|ul|ull)))\s*\(/) {
31563192 WARN("CONSIDER_KSTRTO",
3157− "consider using kstrto* in preference to simple_$1\n" . $herecurr);
3193+ "$1 is obsolete, use k$3 instead\n" . $herecurr);
31583194 }
31593195 # check for __initcall(), use device_initcall() explicitly please
31603196 if ($line =~ /^.\s*__initcall\s*\(/) {
scripts/extract-vmlinux+62−0
@@ -0,0 +1,62 @@
1+#!/bin/sh
2+# ----------------------------------------------------------------------
3+# extract-vmlinux - Extract uncompressed vmlinux from a kernel image
4+#
5+# Inspired from extract-ikconfig
6+# (c) 2009,2010 Dick Streefland <dick@streefland.net>
7+#
8+# (c) 2011 Corentin Chary <corentin.chary@gmail.com>
9+#
10+# Licensed under the GNU General Public License, version 2 (GPLv2).
11+# ----------------------------------------------------------------------
12+
13+check_vmlinux()
14+{
15+ # Use readelf to check if it's a valid ELF
16+ # TODO: find a better to way to check that it's really vmlinux
17+ # and not just an elf
18+ readelf -h $1 > /dev/null 2>&1 || return 1
19+
20+ cat $1
21+ exit 0
22+}
23+
24+try_decompress()
25+{
26+ # The obscure use of the "tr" filter is to work around older versions of
27+ # "grep" that report the byte offset of the line instead of the pattern.
28+
29+ # Try to find the header ($1) and decompress from here
30+ for pos in `tr "$1\n$2" "\n$2=" < "$img" | grep -abo "^$2"`
31+ do
32+ pos=${pos%%:*}
33+ tail -c+$pos "$img" | $3 > $tmp 2> /dev/null
34+ check_vmlinux $tmp
35+ done
36+}
37+
38+# Check invocation:
39+me=${0##*/}
40+img=$1
41+if [ $# -ne 1 -o ! -s "$img" ]
42+then
43+ echo "Usage: $me <kernel-image>" >&2
44+ exit 2
45+fi
46+
47+# Prepare temp files:
48+tmp=$(mktemp /tmp/vmlinux-XXX)
49+trap "rm -f $tmp" 0
50+
51+# Initial attempt for uncompressed images or objects:
52+check_vmlinux $img
53+
54+# That didn't work, so retry after decompression.
55+try_decompress '\037\213\010' xy gunzip
56+try_decompress '\3757zXZ\000' abcde unxz
57+try_decompress 'BZh' xy bunzip2
58+try_decompress '\135\0\0\0' xxx unlzma
59+try_decompress '\211\114\132' xy 'lzop -d'
60+
61+# Bail out:
62+echo "$me: Cannot find vmlinux." >&2
scripts/genksyms/genksyms.c+2−1
@@ -40,7 +40,8 @@ static struct symbol *symtab[HASH_BUCKETS]; · 39 unmodified lines
4040 static FILE *debugfile;
4141
4242 int cur_line = 1;
43−char *cur_filename;
43+char *cur_filename, *source_file;
44+int in_source_file;
4445
4546 static int flag_debug, flag_dump_defs, flag_reference, flag_dump_types,
4647 flag_preserve, flag_warnings;
scripts/genksyms/genksyms.h+3−1
@@ -37,6 +37,7 @@ enum symbol_status { · 36 unmodified lines
3737 struct string_list {
3838 struct string_list *next;
3939 enum symbol_type tag;
40+ int in_source_file;
4041 char *string;
4142 };
4243
@@ -57,7 +58,8 @@ typedef struct string_list **yystype; · 14 unmodified lines
5758 #define YYSTYPE yystype
5859
5960 extern int cur_line;
60−extern char *cur_filename;
61+extern char *cur_filename, *source_file;
62+extern int in_source_file;
6163
6264 struct symbol *find_symbol(const char *name, enum symbol_type ns, int exact);
6365 struct symbol *add_symbol(const char *name, enum symbol_type type,
scripts/genksyms/lex.l+8−0
@@ -116,6 +116,7 @@ MC_TOKEN ([~%^&*+=|<>/-]=)|(&&)|("||")|(->)|(<<)|(>>) · 115 unmodified lines
116116 cur_node->tag = \
117117 find_symbol(cur_node->string, SYM_ENUM_CONST, 1)?\
118118 SYM_ENUM_CONST : SYM_NORMAL ; \
119+ cur_node->in_source_file = in_source_file; \
119120 } while (0)
120121
121122 #define APP _APP(yytext, yyleng)
@@ -166,6 +167,13 @@ repeat: · 44 unmodified lines
166167 cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1);
167168 cur_line = atoi(yytext+2);
168169
170+ if (!source_file) {
171+ source_file = xstrdup(cur_filename);
172+ in_source_file = 1;
173+ } else {
174+ in_source_file = (strcmp(cur_filename, source_file) == 0);
175+ }
176+
169177 goto repeat;
170178 }
171179
scripts/genksyms/lex.lex.c_shipped+10−2
@@ -660,7 +660,7 @@ static int input (void ); · 659 unmodified lines
660660 /* This used to be an fputs(), but since the string might contain NUL's,
661661 * we now use fwrite().
662662 */
663−#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
663+#define ECHO fwrite( yytext, yyleng, 1, yyout )
664664 #endif
665665
666666 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -671,7 +671,7 @@ static int input (void ); · 4 unmodified lines
671671 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
672672 { \
673673 int c = '*'; \
674− unsigned n; \
674+ int n; \
675675 for ( n = 0; n < max_size && \
676676 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
677677 buf[n] = (char) c; \
@@ -1926,6 +1926,7 @@ void yyfree (void * ptr ) · 1248 unmodified lines
19261926 cur_node->tag = \
19271927 find_symbol(cur_node->string, SYM_ENUM_CONST, 1)?\
19281928 SYM_ENUM_CONST : SYM_NORMAL ; \
1929+ cur_node->in_source_file = in_source_file; \
19291930 } while (0)
19301931
19311932 #define APP _APP(yytext, yyleng)
@@ -1975,6 +1976,13 @@ repeat: · 43 unmodified lines
19751976 cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1);
19761977 cur_line = atoi(yytext+2);
19771978
1979+ if (!source_file) {
1980+ source_file = xstrdup(cur_filename);
1981+ in_source_file = 1;
1982+ } else {
1983+ in_source_file = (strcmp(cur_filename, source_file) == 0);
1984+ }
1985+
19781986 goto repeat;
19791987 }
19801988
scripts/genksyms/parse.tab.c_shipped+345−300
@@ -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"
@@ -96,6 +95,25 @@ remove_list(struct string_list **pb, struct string_list **pe) · 44 unmodified lines
9695 free_list(b, e);
9796 }
9897
98+/* Record definition of a struct/union/enum */
99+static void record_compound(struct string_list **keyw,
100+ struct string_list **ident,
101+ struct string_list **body,
102+ enum symbol_type type)
103+{
104+ struct string_list *b = *body, *i = *ident, *r;
105+
106+ if (i->in_source_file) {
107+ remove_node(keyw);
108+ (*ident)->tag = type;
109+ remove_list(body, ident);
110+ return;
111+ }
112+ r = copy_node(i); r->tag = type;
113+ r->next = (*keyw)->next; *body = r; (*keyw)->next = NULL;
114+ add_symbol(i->string, type, b, is_extern);
115+}
116+
99117
100118
101119
@@ -283,11 +301,11 @@ YYID (yyi) · 181 unmodified lines
283301 # define alloca _alloca
284302 # else
285303 # define YYSTACK_ALLOC alloca
286−# 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__ \
287305 || defined __cplusplus || defined _MSC_VER)
288306 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
289−# ifndef _STDLIB_H
290−# define _STDLIB_H 1
307+# ifndef EXIT_SUCCESS
308+# define EXIT_SUCCESS 0
291309 # endif
292310 # endif
293311 # endif
@@ -310,24 +328,24 @@ YYID (yyi) · 16 unmodified lines
310328 # ifndef YYSTACK_ALLOC_MAXIMUM
311329 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
312330 # endif
313−# if (defined __cplusplus && ! defined _STDLIB_H \
331+# if (defined __cplusplus && ! defined EXIT_SUCCESS \
314332 && ! ((defined YYMALLOC || defined malloc) \
315333 && (defined YYFREE || defined free)))
316334 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
317−# ifndef _STDLIB_H
318−# define _STDLIB_H 1
335+# ifndef EXIT_SUCCESS
336+# define EXIT_SUCCESS 0
319337 # endif
320338 # endif
321339 # ifndef YYMALLOC
322340 # define YYMALLOC malloc
323−# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
341+# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
324342 || defined __cplusplus || defined _MSC_VER)
325343 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
326344 # endif
327345 # endif
328346 # ifndef YYFREE
329347 # define YYFREE free
330−# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
348+# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
331349 || defined __cplusplus || defined _MSC_VER)
332350 void free (void *); /* INFRINGES ON USER NAME SPACE */
333351 # endif
@@ -356,23 +374,7 @@ union yyalloc · 22 unmodified lines
356374 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
357375 + YYSTACK_GAP_MAXIMUM)
358376
359−/* Copy COUNT objects from FROM to TO. The source and destination do
360− not overlap. */
361−# ifndef YYCOPY
362−# if defined __GNUC__ && 1 < __GNUC__
363−# define YYCOPY(To, From, Count) \
364− __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
365−# else
366−# define YYCOPY(To, From, Count) \
367− do \
368− { \
369− YYSIZE_T yyi; \
370− for (yyi = 0; yyi < (Count); yyi++) \
371− (To)[yyi] = (From)[yyi]; \
372− } \
373− while (YYID (0))
374−# endif
375−# endif
377+# define YYCOPY_NEEDED 1
376378
377379 /* Relocate STACK from its old location to the new one. The
378380 local variables YYSIZE and YYSTACKSIZE give the old and new number of
@@ -392,6 +394,26 @@ union yyalloc · 13 unmodified lines
392394
393395 #endif
394396
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+
395417 /* YYFINAL -- State number of the termination state. */
396418 #define YYFINAL 4
397419 /* YYLAST -- Last index in YYTABLE. */
@@ -514,20 +536,20 @@ static const yytype_int8 yyrhs[] = · 116 unmodified lines
514536 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
515537 static const yytype_uint16 yyrline[] =
516538 {
517− 0, 104, 104, 105, 109, 109, 115, 115, 117, 117,
518− 119, 120, 121, 122, 123, 124, 128, 142, 143, 147,
519− 155, 168, 174, 175, 179, 180, 184, 190, 194, 195,
520− 196, 197, 198, 202, 203, 204, 205, 209, 211, 213,
521− 217, 224, 231, 241, 244, 245, 249, 250, 251, 252,
522− 253, 254, 255, 256, 257, 258, 259, 263, 268, 269,
523− 273, 274, 278, 278, 278, 279, 287, 288, 292, 301,
524− 303, 305, 307, 309, 316, 317, 321, 322, 323, 325,
525− 327, 329, 331, 336, 337, 338, 342, 343, 347, 348,
526− 353, 358, 360, 364, 365, 373, 377, 379, 381, 383,
527− 385, 390, 399, 400, 405, 410, 411, 415, 416, 420,
528− 421, 425, 427, 432, 433, 437, 438, 442, 443, 444,
529− 448, 452, 453, 457, 458, 462, 463, 466, 471, 479,
530− 483, 484, 488
539+ 0, 123, 123, 124, 128, 128, 134, 134, 136, 136,
540+ 138, 139, 140, 141, 142, 143, 147, 161, 162, 166,
541+ 174, 187, 193, 194, 198, 199, 203, 209, 213, 214,
542+ 215, 216, 217, 221, 222, 223, 224, 228, 230, 232,
543+ 236, 238, 240, 245, 248, 249, 253, 254, 255, 256,
544+ 257, 258, 259, 260, 261, 262, 263, 267, 272, 273,
545+ 277, 278, 282, 282, 282, 283, 291, 292, 296, 305,
546+ 307, 309, 311, 313, 320, 321, 325, 326, 327, 329,
547+ 331, 333, 335, 340, 341, 342, 346, 347, 351, 352,
548+ 357, 362, 364, 368, 369, 377, 381, 383, 385, 387,
549+ 389, 394, 403, 404, 409, 414, 415, 419, 420, 424,
550+ 425, 429, 431, 436, 437, 441, 442, 446, 447, 448,
551+ 452, 456, 457, 461, 462, 466, 467, 470, 475, 483,
552+ 487, 488, 492
531553 };
532554 #endif
533555
@@ -618,8 +640,8 @@ static const yytype_uint8 yyr2[] = · 84 unmodified lines
618640 0, 1, 5
619641 };
620642
621−/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
622− STATE-NUM when YYTABLE doesn't specify something else to do. Zero
643+/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
644+ Performed when YYTABLE doesn't specify something else to do. Zero
623645 means the default is an error. */
624646 static const yytype_uint8 yydefact[] =
625647 {
@@ -692,8 +714,7 @@ static const yytype_int16 yypgoto[] = · 66 unmodified lines
692714
693715 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
694716 positive, shift that token. If negative, reduce the rule which
695− number is the opposite. If zero, do what YYDEFACT says.
696− If YYTABLE_NINF, syntax error. */
717+ number is the opposite. If YYTABLE_NINF, syntax error. */
697718 #define YYTABLE_NINF -109
698719 static const yytype_int16 yytable[] =
699720 {
@@ -753,6 +774,12 @@ static const yytype_int16 yytable[] = · 53 unmodified lines
753774 0, 0, 34
754775 };
755776
777+#define yypact_value_is_default(yystate) \
778+ ((yystate) == (-135))
779+
780+#define yytable_value_is_error(yytable_value) \
781+ YYID (0)
782+
756783 static const yytype_int16 yycheck[] =
757784 {
758785 59, 38, 79, 3, 1, 8, 56, 37, 26, 37,
@@ -869,7 +896,6 @@ do \ · 110 unmodified lines
869896 { \
870897 yychar = (Token); \
871898 yylval = (Value); \
872− yytoken = YYTRANSLATE (yychar); \
873899 YYPOPSTACK (1); \
874900 goto yybackup; \
875901 } \
@@ -911,19 +937,10 @@ while (YYID (0)) · 35 unmodified lines
911937 #endif
912938
913939
914−/* YY_LOCATION_PRINT -- Print the location on the stream.
915− This macro was not mandated originally: define only if we know
916− we won't break user code: when these are the locations we know. */
940+/* This macro is provided for backward compatibility. */
917941
918942 #ifndef YY_LOCATION_PRINT
919−# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
920−# define YY_LOCATION_PRINT(File, Loc) \
921− fprintf (File, "%d.%d-%d.%d", \
922− (Loc).first_line, (Loc).first_column, \
923− (Loc).last_line, (Loc).last_column)
924−# else
925−# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
926−# endif
943+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
927944 #endif
928945
929946
@@ -1115,7 +1132,6 @@ int yydebug; · 185 unmodified lines
11151132 # define YYMAXDEPTH 10000
11161133 #endif
11171134
1118−
11191135
11201136 #if YYERROR_VERBOSE
11211137
@@ -1218,115 +1234,142 @@ yytnamerr (char *yyres, const char *yystr) · 96 unmodified lines
12181234 }
12191235 # endif
12201236
1221−/* Copy into YYRESULT an error message about the unexpected token
1222− YYCHAR while in state YYSTATE. Return the number of bytes copied,
1223− including the terminating null byte. If YYRESULT is null, do not
1224− copy anything; just return the number of bytes that would be
1225− copied. As a special case, return 0 if an ordinary "syntax error"
1226− message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1227− size calculation. */
1228−static YYSIZE_T
1229−yysyntax_error (char *yyresult, int yystate, int yychar)
1230−{
1231− int yyn = yypact[yystate];
1237+/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1238+ about the unexpected token YYTOKEN for the state stack whose top is
1239+ YYSSP.
12321240
1233− if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1234− return 0;
1235− else
1241+ Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1242+ not large enough to hold the message. In that case, also set
1243+ *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1244+ required number of bytes is too large to store. */
1245+static int
1246+yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1247+ yytype_int16 *yyssp, int yytoken)
1248+{
1249+ YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
1250+ YYSIZE_T yysize = yysize0;
1251+ YYSIZE_T yysize1;
1252+ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1253+ /* Internationalized format string. */
1254+ const char *yyformat = 0;
1255+ /* Arguments of yyformat. */
1256+ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1257+ /* Number of reported tokens (one for the "unexpected", one per
1258+ "expected"). */
1259+ int yycount = 0;
1260+
1261+ /* There are many possibilities here to consider:
1262+ - Assume YYFAIL is not used. It's too flawed to consider. See
1263+ <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1264+ for details. YYERROR is fine as it does not invoke this
1265+ function.
1266+ - If this state is a consistent state with a default action, then
1267+ the only way this function was invoked is if the default action
1268+ is an error action. In that case, don't check for expected
1269+ tokens because there are none.
1270+ - The only way there can be no lookahead present (in yychar) is if
1271+ this state is a consistent state with a default action. Thus,
1272+ detecting the absence of a lookahead is sufficient to determine
1273+ that there is no unexpected or expected token to report. In that
1274+ case, just report a simple "syntax error".
1275+ - Don't assume there isn't a lookahead just because this state is a
1276+ consistent state with a default action. There might have been a
1277+ previous inconsistent state, consistent state with a non-default
1278+ action, or user semantic action that manipulated yychar.
1279+ - Of course, the expected token list depends on states to have
1280+ correct lookahead information, and it depends on the parser not
1281+ to perform extra reductions after fetching a lookahead from the
1282+ scanner and before detecting a syntax error. Thus, state merging
1283+ (from LALR or IELR) and default reductions corrupt the expected
1284+ token list. However, the list is correct for canonical LR with
1285+ one exception: it will still contain any token that will not be
1286+ accepted due to an error action in a later state.
1287+ */
1288+ if (yytoken != YYEMPTY)
12361289 {
1237− int yytype = YYTRANSLATE (yychar);
1238− YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1239− YYSIZE_T yysize = yysize0;
1240− YYSIZE_T yysize1;
1241− int yysize_overflow = 0;
1242− enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1243− char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1244− int yyx;
1245−
1246−# if 0
1247− /* This is so xgettext sees the translatable formats that are
1248− constructed on the fly. */
1249− YY_("syntax error, unexpected %s");
1250− YY_("syntax error, unexpected %s, expecting %s");
1251− YY_("syntax error, unexpected %s, expecting %s or %s");
1252− YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1253− YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1254−# endif
1255− char *yyfmt;
1256− char const *yyf;
1257− static char const yyunexpected[] = "syntax error, unexpected %s";
1258− static char const yyexpecting[] = ", expecting %s";
1259− static char const yyor[] = " or %s";
1260− char yyformat[sizeof yyunexpected
1261− + sizeof yyexpecting - 1
1262− + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1263− * (sizeof yyor - 1))];
1264− char const *yyprefix = yyexpecting;
1265−
1266− /* Start YYX at -YYN if negative to avoid negative indexes in
1267− YYCHECK. */
1268− int yyxbegin = yyn < 0 ? -yyn : 0;
1269−
1270− /* Stay within bounds of both yycheck and yytname. */
1271− int yychecklim = YYLAST - yyn + 1;
1272− int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1273− int yycount = 1;
1274−
1275− yyarg[0] = yytname[yytype];
1276− yyfmt = yystpcpy (yyformat, yyunexpected);
1277−
1278− for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1279− if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1280− {
1281− if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1282− {
1283− yycount = 1;
1284− yysize = yysize0;
1285− yyformat[sizeof yyunexpected - 1] = '\0';
1286− break;
1287− }
1288− yyarg[yycount++] = yytname[yyx];
1289− yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1290− yysize_overflow |= (yysize1 < yysize);
1291− yysize = yysize1;
1292− yyfmt = yystpcpy (yyfmt, yyprefix);
1293− yyprefix = yyor;
1294− }
1290+ int yyn = yypact[*yyssp];
1291+ yyarg[yycount++] = yytname[yytoken];
1292+ if (!yypact_value_is_default (yyn))
1293+ {
1294+ /* Start YYX at -YYN if negative to avoid negative indexes in
1295+ YYCHECK. In other words, skip the first -YYN actions for
1296+ this state because they are default actions. */
1297+ int yyxbegin = yyn < 0 ? -yyn : 0;
1298+ /* Stay within bounds of both yycheck and yytname. */
1299+ int yychecklim = YYLAST - yyn + 1;
1300+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1301+ int yyx;
1302+
1303+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1304+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1305+ && !yytable_value_is_error (yytable[yyx + yyn]))
1306+ {
1307+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1308+ {
1309+ yycount = 1;
1310+ yysize = yysize0;
1311+ break;
1312+ }
1313+ yyarg[yycount++] = yytname[yyx];
1314+ yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1315+ if (! (yysize <= yysize1
1316+ && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1317+ return 2;
1318+ yysize = yysize1;
1319+ }
1320+ }
1321+ }
12951322
1296− yyf = YY_(yyformat);
1297− yysize1 = yysize + yystrlen (yyf);
1298− yysize_overflow |= (yysize1 < yysize);
1299− yysize = yysize1;
1323+ switch (yycount)
1324+ {
1325+# define YYCASE_(N, S) \
1326+ case N: \
1327+ yyformat = S; \
1328+ break
1329+ YYCASE_(0, YY_("syntax error"));
1330+ YYCASE_(1, YY_("syntax error, unexpected %s"));
1331+ YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1332+ YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1333+ YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1334+ YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1335+# undef YYCASE_
1336+ }
13001337
1301− if (yysize_overflow)
1302− return YYSIZE_MAXIMUM;
1338+ yysize1 = yysize + yystrlen (yyformat);
1339+ if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1340+ return 2;
1341+ yysize = yysize1;
13031342
1304− if (yyresult)
1305− {
1306− /* Avoid sprintf, as that infringes on the user's name space.
1307− Don't have undefined behavior even if the translation
1308− produced a string with the wrong number of "%s"s. */
1309− char *yyp = yyresult;
1310− int yyi = 0;
1311− while ((*yyp = *yyf) != '\0')
1312− {
1313− if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1314− {
1315− yyp += yytnamerr (yyp, yyarg[yyi++]);
1316− yyf += 2;
1317− }
1318− else
1319− {
1320− yyp++;
1321− yyf++;
1322− }
1323− }
1324− }
1325− return yysize;
1343+ if (*yymsg_alloc < yysize)
1344+ {
1345+ *yymsg_alloc = 2 * yysize;
1346+ if (! (yysize <= *yymsg_alloc
1347+ && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1348+ *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1349+ return 1;
13261350 }
1351+
1352+ /* Avoid sprintf, as that infringes on the user's name space.
1353+ Don't have undefined behavior even if the translation
1354+ produced a string with the wrong number of "%s"s. */
1355+ {
1356+ char *yyp = *yymsg;
1357+ int yyi = 0;
1358+ while ((*yyp = *yyformat) != '\0')
1359+ if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1360+ {
1361+ yyp += yytnamerr (yyp, yyarg[yyi++]);
1362+ yyformat += 2;
1363+ }
1364+ else
1365+ {
1366+ yyp++;
1367+ yyformat++;
1368+ }
1369+ }
1370+ return 0;
13271371 }
13281372 #endif /* YYERROR_VERBOSE */
1329−
13301373
13311374 /*-----------------------------------------------.
13321375 | Release the memory associated to this symbol. |
@@ -1359,6 +1402,7 @@ yydestruct (yymsg, yytype, yyvaluep) · 26 unmodified lines
13591402 }
13601403 }
13611404
1405+
13621406 /* Prevent warnings from -Wmissing-prototypes. */
13631407 #ifdef YYPARSE_PARAM
13641408 #if defined __STDC__ || defined __cplusplus
@@ -1385,10 +1429,9 @@ YYSTYPE yylval; · 20 unmodified lines
13851429 int yynerrs;
13861430
13871431
1388−
1389−/*-------------------------.
1390−| yyparse or yypush_parse. |
1391−`-------------------------*/
1432+/*----------.
1433+| yyparse. |
1434+`----------*/
13921435
13931436 #ifdef YYPARSE_PARAM
13941437 #if (defined __STDC__ || defined __C99__FUNC__ \
@@ -1412,8 +1455,6 @@ yyparse () · 17 unmodified lines
14121455 #endif
14131456 #endif
14141457 {
1415−
1416−
14171458 int yystate;
14181459 /* Number of tokens to shift before error messages enabled. */
14191460 int yyerrstatus;
@@ -1568,7 +1609,7 @@ yybackup: · 148 unmodified lines
15681609
15691610 /* First try to decide what to do without reference to lookahead token. */
15701611 yyn = yypact[yystate];
1571− if (yyn == YYPACT_NINF)
1612+ if (yypact_value_is_default (yyn))
15721613 goto yydefault;
15731614
15741615 /* Not known => get a lookahead token if don't already have one. */
@@ -1599,8 +1640,8 @@ yybackup: · 24 unmodified lines
15991640 yyn = yytable[yyn];
16001641 if (yyn <= 0)
16011642 {
1602− if (yyn == 0 || yyn == YYTABLE_NINF)
1603− goto yyerrlab;
1643+ if (yytable_value_is_error (yyn))
1644+ goto yyerrlab;
16041645 yyn = -yyn;
16051646 goto yyreduce;
16061647 }
@@ -1655,42 +1696,42 @@ yyreduce: · 48 unmodified lines
16551696 {
16561697 case 4:
16571698
1658− { is_typedef = 0; is_extern = 0; current_name = NULL; decl_spec = NULL; ;}
1699+ { is_typedef = 0; is_extern = 0; current_name = NULL; decl_spec = NULL; }
16591700 break;
16601701
16611702 case 5:
16621703
1663− { free_list(*(yyvsp[(2) - (2)]), NULL); *(yyvsp[(2) - (2)]) = NULL; ;}
1704+ { free_list(*(yyvsp[(2) - (2)]), NULL); *(yyvsp[(2) - (2)]) = NULL; }
16641705 break;
16651706
16661707 case 6:
16671708
1668− { is_typedef = 1; ;}
1709+ { is_typedef = 1; }
16691710 break;
16701711
16711712 case 7:
16721713
1673− { (yyval) = (yyvsp[(4) - (4)]); ;}
1714+ { (yyval) = (yyvsp[(4) - (4)]); }
16741715 break;
16751716
16761717 case 8:
16771718
1678− { is_typedef = 1; ;}
1719+ { is_typedef = 1; }
16791720 break;
16801721
16811722 case 9:
16821723
1683− { (yyval) = (yyvsp[(3) - (3)]); ;}
1724+ { (yyval) = (yyvsp[(3) - (3)]); }
16841725 break;
16851726
16861727 case 14:
16871728
1688− { (yyval) = (yyvsp[(2) - (2)]); ;}
1729+ { (yyval) = (yyvsp[(2) - (2)]); }
16891730 break;
16901731
16911732 case 15:
16921733
1693− { (yyval) = (yyvsp[(2) - (2)]); ;}
1734+ { (yyval) = (yyvsp[(2) - (2)]); }
16941735 break;
16951736
16961737 case 16:
@@ -1704,12 +1745,12 @@ yyreduce: · 7 unmodified lines
17041745 current_name = NULL;
17051746 }
17061747 (yyval) = (yyvsp[(3) - (3)]);
1707− ;}
1748+ }
17081749 break;
17091750
17101751 case 17:
17111752
1712− { (yyval) = NULL; ;}
1753+ { (yyval) = NULL; }
17131754 break;
17141755
17151756 case 19:
@@ -1720,7 +1761,7 @@ yyreduce: · 4 unmodified lines
17201761 is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern);
17211762 current_name = NULL;
17221763 (yyval) = (yyvsp[(1) - (1)]);
1723− ;}
1764+ }
17241765 break;
17251766
17261767 case 20:
@@ -1733,27 +1774,27 @@ yyreduce: · 6 unmodified lines
17331774 is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern);
17341775 current_name = NULL;
17351776 (yyval) = (yyvsp[(3) - (3)]);
1736− ;}
1777+ }
17371778 break;
17381779
17391780 case 21:
17401781
1741− { (yyval) = (yyvsp[(4) - (4)]) ? (yyvsp[(4) - (4)]) : (yyvsp[(3) - (4)]) ? (yyvsp[(3) - (4)]) : (yyvsp[(2) - (4)]) ? (yyvsp[(2) - (4)]) : (yyvsp[(1) - (4)]); ;}
1782+ { (yyval) = (yyvsp[(4) - (4)]) ? (yyvsp[(4) - (4)]) : (yyvsp[(3) - (4)]) ? (yyvsp[(3) - (4)]) : (yyvsp[(2) - (4)]) ? (yyvsp[(2) - (4)]) : (yyvsp[(1) - (4)]); }
17421783 break;
17431784
17441785 case 22:
17451786
1746− { decl_spec = NULL; ;}
1787+ { decl_spec = NULL; }
17471788 break;
17481789
17491790 case 24:
17501791
1751− { decl_spec = *(yyvsp[(1) - (1)]); ;}
1792+ { decl_spec = *(yyvsp[(1) - (1)]); }
17521793 break;
17531794
17541795 case 25:
17551796
1756− { decl_spec = *(yyvsp[(2) - (2)]); ;}
1797+ { decl_spec = *(yyvsp[(2) - (2)]); }
17571798 break;
17581799
17591800 case 26:
@@ -1762,97 +1803,82 @@ yyreduce: · 2 unmodified lines
17621803 is really irrelevant to the linkage. */
17631804 remove_node((yyvsp[(1) - (1)]));
17641805 (yyval) = (yyvsp[(1) - (1)]);
1765− ;}
1806+ }
17661807 break;
17671808
17681809 case 31:
17691810
1770− { is_extern = 1; (yyval) = (yyvsp[(1) - (1)]); ;}
1811+ { is_extern = 1; (yyval) = (yyvsp[(1) - (1)]); }
17711812 break;
17721813
17731814 case 32:
17741815
1775− { is_extern = 0; (yyval) = (yyvsp[(1) - (1)]); ;}
1816+ { is_extern = 0; (yyval) = (yyvsp[(1) - (1)]); }
17761817 break;
17771818
17781819 case 37:
17791820
1780− { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_STRUCT; (yyval) = (yyvsp[(2) - (2)]); ;}
1821+ { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_STRUCT; (yyval) = (yyvsp[(2) - (2)]); }
17811822 break;
17821823
17831824 case 38:
17841825
1785− { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_UNION; (yyval) = (yyvsp[(2) - (2)]); ;}
1826+ { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_UNION; (yyval) = (yyvsp[(2) - (2)]); }
17861827 break;
17871828
17881829 case 39:
17891830
1790− { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_ENUM; (yyval) = (yyvsp[(2) - (2)]); ;}
1831+ { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_ENUM; (yyval) = (yyvsp[(2) - (2)]); }
17911832 break;
17921833
17931834 case 40:
17941835
1795− { struct string_list *s = *(yyvsp[(3) - (3)]), *i = *(yyvsp[(2) - (3)]), *r;
1796− r = copy_node(i); r->tag = SYM_STRUCT;
1797− r->next = (*(yyvsp[(1) - (3)]))->next; *(yyvsp[(3) - (3)]) = r; (*(yyvsp[(1) - (3)]))->next = NULL;
1798− add_symbol(i->string, SYM_STRUCT, s, is_extern);
1799− (yyval) = (yyvsp[(3) - (3)]);
1800− ;}
1836+ { record_compound((yyvsp[(1) - (3)]), (yyvsp[(2) - (3)]), (yyvsp[(3) - (3)]), SYM_STRUCT); (yyval) = (yyvsp[(3) - (3)]); }
18011837 break;
18021838
18031839 case 41:
18041840
1805− { struct string_list *s = *(yyvsp[(3) - (3)]), *i = *(yyvsp[(2) - (3)]), *r;
1806− r = copy_node(i); r->tag = SYM_UNION;
1807− r->next = (*(yyvsp[(1) - (3)]))->next; *(yyvsp[(3) - (3)]) = r; (*(yyvsp[(1) - (3)]))->next = NULL;
1808− add_symbol(i->string, SYM_UNION, s, is_extern);
1809− (yyval) = (yyvsp[(3) - (3)]);
1810− ;}
1841+ { record_compound((yyvsp[(1) - (3)]), (yyvsp[(2) - (3)]), (yyvsp[(3) - (3)]), SYM_UNION); (yyval) = (yyvsp[(3) - (3)]); }
18111842 break;
18121843
18131844 case 42:
18141845
1815− { struct string_list *s = *(yyvsp[(3) - (3)]), *i = *(yyvsp[(2) - (3)]), *r;
1816− r = copy_node(i); r->tag = SYM_ENUM;
1817− r->next = (*(yyvsp[(1) - (3)]))->next; *(yyvsp[(3) - (3)]) = r; (*(yyvsp[(1) - (3)]))->next = NULL;
1818− add_symbol(i->string, SYM_ENUM, s, is_extern);
1819− (yyval) = (yyvsp[(3) - (3)]);
1820− ;}
1846+ { record_compound((yyvsp[(1) - (3)]), (yyvsp[(2) - (3)]), (yyvsp[(3) - (3)]), SYM_ENUM); (yyval) = (yyvsp[(3) - (3)]); }
18211847 break;
18221848
18231849 case 43:
18241850
1825− { add_symbol(NULL, SYM_ENUM, NULL, 0); (yyval) = (yyvsp[(2) - (2)]); ;}
1851+ { add_symbol(NULL, SYM_ENUM, NULL, 0); (yyval) = (yyvsp[(2) - (2)]); }
18261852 break;
18271853
18281854 case 44:
18291855
1830− { (yyval) = (yyvsp[(2) - (2)]); ;}
1856+ { (yyval) = (yyvsp[(2) - (2)]); }
18311857 break;
18321858
18331859 case 45:
18341860
1835− { (yyval) = (yyvsp[(2) - (2)]); ;}
1861+ { (yyval) = (yyvsp[(2) - (2)]); }
18361862 break;
18371863
18381864 case 56:
18391865
1840− { (*(yyvsp[(1) - (1)]))->tag = SYM_TYPEDEF; (yyval) = (yyvsp[(1) - (1)]); ;}
1866+ { (*(yyvsp[(1) - (1)]))->tag = SYM_TYPEDEF; (yyval) = (yyvsp[(1) - (1)]); }
18411867 break;
18421868
18431869 case 57:
18441870
1845− { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;}
1871+ { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); }
18461872 break;
18471873
18481874 case 58:
18491875
1850− { (yyval) = NULL; ;}
1876+ { (yyval) = NULL; }
18511877 break;
18521878
18531879 case 61:
18541880
1855− { (yyval) = (yyvsp[(2) - (2)]); ;}
1881+ { (yyval) = (yyvsp[(2) - (2)]); }
18561882 break;
18571883
18581884 case 65:
@@ -1860,12 +1886,12 @@ yyreduce: · 1 unmodified line
18601886 { /* restrict has no effect in prototypes so ignore it */
18611887 remove_node((yyvsp[(1) - (1)]));
18621888 (yyval) = (yyvsp[(1) - (1)]);
1863− ;}
1889+ }
18641890 break;
18651891
18661892 case 66:
18671893
1868− { (yyval) = (yyvsp[(2) - (2)]); ;}
1894+ { (yyval) = (yyvsp[(2) - (2)]); }
18691895 break;
18701896
18711897 case 68:
@@ -1877,97 +1903,97 @@ yyreduce: · 5 unmodified lines
18771903 current_name = (*(yyvsp[(1) - (1)]))->string;
18781904 (yyval) = (yyvsp[(1) - (1)]);
18791905 }
1880− ;}
1906+ }
18811907 break;
18821908
18831909 case 69:
18841910
1885− { (yyval) = (yyvsp[(4) - (4)]); ;}
1911+ { (yyval) = (yyvsp[(4) - (4)]); }
18861912 break;
18871913
18881914 case 70:
18891915
1890− { (yyval) = (yyvsp[(4) - (4)]); ;}
1916+ { (yyval) = (yyvsp[(4) - (4)]); }
18911917 break;
18921918
18931919 case 71:
18941920
1895− { (yyval) = (yyvsp[(2) - (2)]); ;}
1921+ { (yyval) = (yyvsp[(2) - (2)]); }
18961922 break;
18971923
18981924 case 72:
18991925
1900− { (yyval) = (yyvsp[(3) - (3)]); ;}
1926+ { (yyval) = (yyvsp[(3) - (3)]); }
19011927 break;
19021928
19031929 case 73:
19041930
1905− { (yyval) = (yyvsp[(3) - (3)]); ;}
1931+ { (yyval) = (yyvsp[(3) - (3)]); }
19061932 break;
19071933
19081934 case 74:
19091935
1910− { (yyval) = (yyvsp[(2) - (2)]); ;}
1936+ { (yyval) = (yyvsp[(2) - (2)]); }
19111937 break;
19121938
19131939 case 78:
19141940
1915− { (yyval) = (yyvsp[(4) - (4)]); ;}
1941+ { (yyval) = (yyvsp[(4) - (4)]); }
19161942 break;
19171943
19181944 case 79:
19191945
1920− { (yyval) = (yyvsp[(4) - (4)]); ;}
1946+ { (yyval) = (yyvsp[(4) - (4)]); }
19211947 break;
19221948
19231949 case 80:
19241950
1925− { (yyval) = (yyvsp[(2) - (2)]); ;}
1951+ { (yyval) = (yyvsp[(2) - (2)]); }
19261952 break;
19271953
19281954 case 81:
19291955
1930− { (yyval) = (yyvsp[(3) - (3)]); ;}
1956+ { (yyval) = (yyvsp[(3) - (3)]); }
19311957 break;
19321958
19331959 case 82:
19341960
1935− { (yyval) = (yyvsp[(3) - (3)]); ;}
1961+ { (yyval) = (yyvsp[(3) - (3)]); }
19361962 break;
19371963
19381964 case 83:
19391965
1940− { (yyval) = (yyvsp[(2) - (2)]); ;}
1966+ { (yyval) = (yyvsp[(2) - (2)]); }
19411967 break;
19421968
19431969 case 85:
19441970
1945− { (yyval) = (yyvsp[(3) - (3)]); ;}
1971+ { (yyval) = (yyvsp[(3) - (3)]); }
19461972 break;
19471973
19481974 case 86:
19491975
1950− { (yyval) = NULL; ;}
1976+ { (yyval) = NULL; }
19511977 break;
19521978
19531979 case 89:
19541980
1955− { (yyval) = (yyvsp[(3) - (3)]); ;}
1981+ { (yyval) = (yyvsp[(3) - (3)]); }
19561982 break;
19571983
19581984 case 90:
19591985
1960− { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;}
1986+ { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); }
19611987 break;
19621988
19631989 case 91:
19641990
1965− { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;}
1991+ { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); }
19661992 break;
19671993
19681994 case 93:
19691995
1970− { (yyval) = NULL; ;}
1996+ { (yyval) = NULL; }
19711997 break;
19721998
19731999 case 94:
@@ -1976,39 +2002,39 @@ yyreduce: · 2 unmodified lines
19762002 private parameter names. */
19772003 remove_node((yyvsp[(1) - (1)]));
19782004 (yyval) = (yyvsp[(1) - (1)]);
1979− ;}
2005+ }
19802006 break;
19812007
19822008 case 95:
19832009
19842010 { remove_node((yyvsp[(1) - (1)]));
19852011 (yyval) = (yyvsp[(1) - (1)]);
1986− ;}
2012+ }
19872013 break;
19882014
19892015 case 96:
19902016
1991− { (yyval) = (yyvsp[(4) - (4)]); ;}
2017+ { (yyval) = (yyvsp[(4) - (4)]); }
19922018 break;
19932019
19942020 case 97:
19952021
1996− { (yyval) = (yyvsp[(4) - (4)]); ;}
2022+ { (yyval) = (yyvsp[(4) - (4)]); }
19972023 break;
19982024
19992025 case 98:
20002026
2001− { (yyval) = (yyvsp[(2) - (2)]); ;}
2027+ { (yyval) = (yyvsp[(2) - (2)]); }
20022028 break;
20032029
20042030 case 99:
20052031
2006− { (yyval) = (yyvsp[(3) - (3)]); ;}
2032+ { (yyval) = (yyvsp[(3) - (3)]); }
20072033 break;
20082034
20092035 case 100:
20102036
2011− { (yyval) = (yyvsp[(3) - (3)]); ;}
2037+ { (yyval) = (yyvsp[(3) - (3)]); }
20122038 break;
20132039
20142040 case 101:
@@ -2017,87 +2043,87 @@ yyreduce: · 2 unmodified lines
20172043 *(yyvsp[(2) - (3)]) = NULL;
20182044 add_symbol(current_name, SYM_NORMAL, decl, is_extern);
20192045 (yyval) = (yyvsp[(3) - (3)]);
2020− ;}
2046+ }
20212047 break;
20222048
20232049 case 102:
20242050
2025− { (yyval) = NULL; ;}
2051+ { (yyval) = NULL; }
20262052 break;
20272053
20282054 case 104:
20292055
2030− { remove_list((yyvsp[(2) - (2)]), &(*(yyvsp[(1) - (2)]))->next); (yyval) = (yyvsp[(2) - (2)]); ;}
2056+ { remove_list((yyvsp[(2) - (2)]), &(*(yyvsp[(1) - (2)]))->next); (yyval) = (yyvsp[(2) - (2)]); }
20312057 break;
20322058
20332059 case 105:
20342060
2035− { (yyval) = (yyvsp[(3) - (3)]); ;}
2061+ { (yyval) = (yyvsp[(3) - (3)]); }
20362062 break;
20372063
20382064 case 106:
20392065
2040− { (yyval) = (yyvsp[(3) - (3)]); ;}
2066+ { (yyval) = (yyvsp[(3) - (3)]); }
20412067 break;
20422068
20432069 case 107:
20442070
2045− { (yyval) = NULL; ;}
2071+ { (yyval) = NULL; }
20462072 break;
20472073
20482074 case 110:
20492075
2050− { (yyval) = (yyvsp[(2) - (2)]); ;}
2076+ { (yyval) = (yyvsp[(2) - (2)]); }
20512077 break;
20522078
20532079 case 111:
20542080
2055− { (yyval) = (yyvsp[(3) - (3)]); ;}
2081+ { (yyval) = (yyvsp[(3) - (3)]); }
20562082 break;
20572083
20582084 case 112:
20592085
2060− { (yyval) = (yyvsp[(2) - (2)]); ;}
2086+ { (yyval) = (yyvsp[(2) - (2)]); }
20612087 break;
20622088
20632089 case 113:
20642090
2065− { (yyval) = NULL; ;}
2091+ { (yyval) = NULL; }
20662092 break;
20672093
20682094 case 116:
20692095
2070− { (yyval) = (yyvsp[(3) - (3)]); ;}
2096+ { (yyval) = (yyvsp[(3) - (3)]); }
20712097 break;
20722098
20732099 case 117:
20742100
2075− { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;}
2101+ { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); }
20762102 break;
20772103
20782104 case 118:
20792105
2080− { (yyval) = (yyvsp[(2) - (2)]); ;}
2106+ { (yyval) = (yyvsp[(2) - (2)]); }
20812107 break;
20822108
20832109 case 120:
20842110
2085− { (yyval) = (yyvsp[(2) - (2)]); ;}
2111+ { (yyval) = (yyvsp[(2) - (2)]); }
20862112 break;
20872113
20882114 case 121:
20892115
2090− { (yyval) = NULL; ;}
2116+ { (yyval) = NULL; }
20912117 break;
20922118
20932119 case 123:
20942120
2095− { (yyval) = (yyvsp[(3) - (3)]); ;}
2121+ { (yyval) = (yyvsp[(3) - (3)]); }
20962122 break;
20972123
20982124 case 124:
20992125
2100− { (yyval) = (yyvsp[(4) - (4)]); ;}
2126+ { (yyval) = (yyvsp[(4) - (4)]); }
21012127 break;
21022128
21032129 case 127:
@@ -2105,7 +2131,7 @@ yyreduce: · 1 unmodified line
21052131 {
21062132 const char *name = strdup((*(yyvsp[(1) - (1)]))->string);
21072133 add_symbol(name, SYM_ENUM_CONST, NULL, 0);
2108− ;}
2134+ }
21092135 break;
21102136
21112137 case 128:
@@ -2114,28 +2140,39 @@ yyreduce: · 2 unmodified lines
21142140 const char *name = strdup((*(yyvsp[(1) - (3)]))->string);
21152141 struct string_list *expr = copy_list_range(*(yyvsp[(3) - (3)]), *(yyvsp[(2) - (3)]));
21162142 add_symbol(name, SYM_ENUM_CONST, expr, 0);
2117− ;}
2143+ }
21182144 break;
21192145
21202146 case 129:
21212147
2122− { (yyval) = (yyvsp[(2) - (2)]); ;}
2148+ { (yyval) = (yyvsp[(2) - (2)]); }
21232149 break;
21242150
21252151 case 130:
21262152
2127− { (yyval) = NULL; ;}
2153+ { (yyval) = NULL; }
21282154 break;
21292155
21302156 case 132:
21312157
2132− { export_symbol((*(yyvsp[(3) - (5)]))->string); (yyval) = (yyvsp[(5) - (5)]); ;}
2158+ { export_symbol((*(yyvsp[(3) - (5)]))->string); (yyval) = (yyvsp[(5) - (5)]); }
21332159 break;
21342160
21352161
21362162
21372163 default: break;
21382164 }
2165+ /* User semantic actions sometimes alter yychar, and that requires
2166+ that yytoken be updated with the new translation. We take the
2167+ approach of translating immediately before every use of yytoken.
2168+ One alternative is translating here after every semantic action,
2169+ but that translation would be missed if the semantic action invokes
2170+ YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2171+ if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2172+ incorrect destructor might then be invoked immediately. In the
2173+ case of YYERROR or YYBACKUP, subsequent parser actions might lead
2174+ to an incorrect destructor call or verbose syntax error message
2175+ before the lookahead is translated. */
21392176 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
21402177
21412178 YYPOPSTACK (yylen);
@@ -2163,6 +2200,10 @@ yyreduce: · 21 unmodified lines
21632200 | yyerrlab -- here on detecting error |
21642201 `------------------------------------*/
21652202 yyerrlab:
2203+ /* Make sure we have latest lookahead translation. See comments at
2204+ user semantic actions for why this is necessary. */
2205+ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2206+
21662207 /* If not already recovering from an error, report this error. */
21672208 if (!yyerrstatus)
21682209 {
@@ -2170,37 +2211,36 @@ yyerrlab: · 1 unmodified line
21702211 #if ! YYERROR_VERBOSE
21712212 yyerror (YY_("syntax error"));
21722213 #else
2214+# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2215+ yyssp, yytoken)
21732216 {
2174− YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2175− if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2176− {
2177− YYSIZE_T yyalloc = 2 * yysize;
2178− if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2179− yyalloc = YYSTACK_ALLOC_MAXIMUM;
2180− if (yymsg != yymsgbuf)
2181− YYSTACK_FREE (yymsg);
2182− yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2183− if (yymsg)
2184− yymsg_alloc = yyalloc;
2185− else
2186− {
2187− yymsg = yymsgbuf;
2188− yymsg_alloc = sizeof yymsgbuf;
2189− }
2190− }
2191−
2192− if (0 < yysize && yysize <= yymsg_alloc)
2193− {
2194− (void) yysyntax_error (yymsg, yystate, yychar);
2195− yyerror (yymsg);
2196− }
2197− else
2198− {
2199− yyerror (YY_("syntax error"));
2200− if (yysize != 0)
2201− goto yyexhaustedlab;
2202− }
2217+ char const *yymsgp = YY_("syntax error");
2218+ int yysyntax_error_status;
2219+ yysyntax_error_status = YYSYNTAX_ERROR;
2220+ if (yysyntax_error_status == 0)
2221+ yymsgp = yymsg;
2222+ else if (yysyntax_error_status == 1)
2223+ {
2224+ if (yymsg != yymsgbuf)
2225+ YYSTACK_FREE (yymsg);
2226+ yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2227+ if (!yymsg)
2228+ {
2229+ yymsg = yymsgbuf;
2230+ yymsg_alloc = sizeof yymsgbuf;
2231+ yysyntax_error_status = 2;
2232+ }
2233+ else
2234+ {
2235+ yysyntax_error_status = YYSYNTAX_ERROR;
2236+ yymsgp = yymsg;
2237+ }
2238+ }
2239+ yyerror (yymsgp);
2240+ if (yysyntax_error_status == 2)
2241+ goto yyexhaustedlab;
22032242 }
2243+# undef YYSYNTAX_ERROR
22042244 #endif
22052245 }
22062246
@@ -2259,7 +2299,7 @@ yyerrlab1: · 52 unmodified lines
22592299 for (;;)
22602300 {
22612301 yyn = yypact[yystate];
2262− if (yyn != YYPACT_NINF)
2302+ if (!yypact_value_is_default (yyn))
22632303 {
22642304 yyn += YYTERROR;
22652305 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
@@ -2318,8 +2358,13 @@ yyexhaustedlab: · 52 unmodified lines
23182358
23192359 yyreturn:
23202360 if (yychar != YYEMPTY)
2321− yydestruct ("Cleanup: discarding lookahead",
2322− yytoken, &yylval);
2361+ {
2362+ /* Make sure we have latest lookahead translation. See comments at
2363+ user semantic actions for why this is necessary. */
2364+ yytoken = YYTRANSLATE (yychar);
2365+ yydestruct ("Cleanup: discarding lookahead",
2366+ yytoken, &yylval);
2367+ }
23232368 /* Do not reclaim the symbols of the rule which action triggered
23242369 this YYABORT or YYACCEPT. */
23252370 YYPOPSTACK (yylen);
scripts/genksyms/parse.tab.h_shipped+3−4
@@ -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 interface for Bison's Yacc-like parsers in C
3+/* Bison interface 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
scripts/genksyms/parse.y+22−18
@@ -51,6 +51,25 @@ remove_list(struct string_list **pb, struct string_list **pe) · 50 unmodified lines
5151 free_list(b, e);
5252 }
5353
54+/* Record definition of a struct/union/enum */
55+static void record_compound(struct string_list **keyw,
56+ struct string_list **ident,
57+ struct string_list **body,
58+ enum symbol_type type)
59+{
60+ struct string_list *b = *body, *i = *ident, *r;
61+
62+ if (i->in_source_file) {
63+ remove_node(keyw);
64+ (*ident)->tag = type;
65+ remove_list(body, ident);
66+ return;
67+ }
68+ r = copy_node(i); r->tag = type;
69+ r->next = (*keyw)->next; *body = r; (*keyw)->next = NULL;
70+ add_symbol(i->string, type, b, is_extern);
71+}
72+
5473 %}
5574
5675 %token ASM_KEYW
@@ -215,26 +234,11 @@ type_specifier: · 158 unmodified lines
215234
216235 /* Full definitions of an s/u/e. Record it. */
217236 | STRUCT_KEYW IDENT class_body
218− { struct string_list *s = *$3, *i = *$2, *r;
219− r = copy_node(i); r->tag = SYM_STRUCT;
220− r->next = (*$1)->next; *$3 = r; (*$1)->next = NULL;
221− add_symbol(i->string, SYM_STRUCT, s, is_extern);
222− $$ = $3;
223− }
237+ { record_compound($1, $2, $3, SYM_STRUCT); $$ = $3; }
224238 | UNION_KEYW IDENT class_body
225− { struct string_list *s = *$3, *i = *$2, *r;
226− r = copy_node(i); r->tag = SYM_UNION;
227− r->next = (*$1)->next; *$3 = r; (*$1)->next = NULL;
228− add_symbol(i->string, SYM_UNION, s, is_extern);
229− $$ = $3;
230− }
239+ { record_compound($1, $2, $3, SYM_UNION); $$ = $3; }
231240 | ENUM_KEYW IDENT enum_body
232− { struct string_list *s = *$3, *i = *$2, *r;
233− r = copy_node(i); r->tag = SYM_ENUM;
234− r->next = (*$1)->next; *$3 = r; (*$1)->next = NULL;
235− add_symbol(i->string, SYM_ENUM, s, is_extern);
236− $$ = $3;
237− }
241+ { record_compound($1, $2, $3, SYM_ENUM); $$ = $3; }
238242 /*
239243 * Anonymous enum definition. Tell add_symbol() to restart its counter.
240244 */
scripts/kconfig/Makefile+2−26
@@ -33,17 +33,9 @@ silentoldconfig: $(obj)/conf · 32 unmodified lines
3333 $(Q)mkdir -p include/generated
3434 $< --$@ $(Kconfig)
3535
36−# if no path is given, then use src directory to find file
37−ifdef LSMOD
38−LSMOD_F := $(LSMOD)
39−ifeq ($(findstring /,$(LSMOD)),)
40− LSMOD_F := $(objtree)/$(LSMOD)
41−endif
42−endif
43−
44−localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
36+localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
4537 $(Q)mkdir -p include/generated
46− $(Q)perl $< $(srctree) $(Kconfig) $(LSMOD_F) > .tmp.config
38+ $(Q)perl $< --$@ $(srctree) $(Kconfig) > .tmp.config
4739 $(Q)if [ -f .config ]; then \
4840 cmp -s .tmp.config .config || \
4941 (mv -f .config .config.old.1; \
@@ -56,22 +48,6 @@ localmodconfig: $(obj)/streamline_config.pl $(obj)/conf · 6 unmodified lines
5648 fi
5749 $(Q)rm -f .tmp.config
5850
59−localyesconfig: $(obj)/streamline_config.pl $(obj)/conf
60− $(Q)mkdir -p include/generated
61− $(Q)perl $< $(srctree) $(Kconfig) $(LSMOD_F) > .tmp.config
62− $(Q)sed -i s/=m/=y/ .tmp.config
63− $(Q)if [ -f .config ]; then \
64− cmp -s .tmp.config .config || \
65− (mv -f .config .config.old.1; \
66− mv -f .tmp.config .config; \
67− $(obj)/conf --silentoldconfig $(Kconfig); \
68− mv -f .config.old.1 .config.old) \
69− else \
70− mv -f .tmp.config .config; \
71− $(obj)/conf --silentoldconfig $(Kconfig); \
72− fi
73− $(Q)rm -f .tmp.config
74−
7551 # Create new linux.pot file
7652 # Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files
7753 # The symlink is used to repair a deficiency in arch/um
scripts/kconfig/confdata.c+36−13
@@ -503,17 +503,6 @@ header_print_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg) · 502 unmodified lines
503503 fprintf(fp, "#define %s%s%s 1\n",
504504 CONFIG_, sym->name, suffix);
505505 }
506− /*
507− * Generate the __enabled_CONFIG_* and
508− * __enabled_CONFIG_*_MODULE macros for use by the
509− * IS_{ENABLED,BUILTIN,MODULE} macros. The _MODULE variant is
510− * generated even for booleans so that the IS_ENABLED() macro
511− * works.
512− */
513− fprintf(fp, "#define __enabled_" CONFIG_ "%s %d\n",
514− sym->name, (*value == 'y'));
515− fprintf(fp, "#define __enabled_" CONFIG_ "%s_MODULE %d\n",
516− sym->name, (*value == 'm'));
517506 break;
518507 }
519508 case S_HEX: {
@@ -564,6 +553,35 @@ static struct conf_printer header_printer_cb = · 44 unmodified lines
564553 .print_comment = header_print_comment,
565554 };
566555
556+/*
557+ * Generate the __enabled_CONFIG_* and __enabled_CONFIG_*_MODULE macros for
558+ * use by the IS_{ENABLED,BUILTIN,MODULE} macros. The _MODULE variant is
559+ * generated even for booleans so that the IS_ENABLED() macro works.
560+ */
561+static void
562+header_print__enabled_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg)
563+{
564+
565+ switch (sym->type) {
566+ case S_BOOLEAN:
567+ case S_TRISTATE: {
568+ fprintf(fp, "#define __enabled_" CONFIG_ "%s %d\n",
569+ sym->name, (*value == 'y'));
570+ fprintf(fp, "#define __enabled_" CONFIG_ "%s_MODULE %d\n",
571+ sym->name, (*value == 'm'));
572+ break;
573+ }
574+ default:
575+ break;
576+ }
577+}
578+
579+static struct conf_printer header__enabled_printer_cb =
580+{
581+ .print_symbol = header_print__enabled_symbol,
582+ .print_comment = header_print_comment,
583+};
584+
567585 /*
568586 * Tristate printer
569587 *
@@ -945,11 +963,16 @@ int conf_write_autoconf(void) · 375 unmodified lines
945963 conf_write_heading(out_h, &header_printer_cb, NULL);
946964
947965 for_all_symbols(i, sym) {
966+ if (!sym->name)
967+ continue;
968+
948969 sym_calc_value(sym);
949− if (!(sym->flags & SYMBOL_WRITE) || !sym->name)
970+
971+ conf_write_symbol(out_h, sym, &header__enabled_printer_cb, NULL);
972+
973+ if (!(sym->flags & SYMBOL_WRITE))
950974 continue;
951975
952− /* write symbol to auto.conf, tristate and header files */
953976 conf_write_symbol(out, sym, &kconfig_printer_cb, (void *)1);
954977
955978 conf_write_symbol(tristate, sym, &tristate_printer_cb, (void *)1);
scripts/kconfig/lxdialog/textbox.c+1−2
@@ -320,7 +320,6 @@ static void print_page(WINDOW * win, int height, int width) · 319 unmodified lines
320320 */
321321 static void print_line(WINDOW * win, int row, int width)
322322 {
323− int y, x;
324323 char *line;
325324
326325 line = get_line();
@@ -329,10 +328,10 @@ static void print_line(WINDOW * win, int row, int width) · 2 unmodified lines
329328 waddch(win, ' ');
330329 waddnstr(win, line, MIN(strlen(line), width - 2));
331330
332− getyx(win, y, x);
333331 /* Clear 'residue' of previous line */
334332 #if OLD_NCURSES
335333 {
334+ int x = getcurx(win);
336335 int i;
337336 for (i = 0; i < width - x; i++)
338337 waddch(win, ' ');
scripts/kconfig/mconf.c+52−34
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 #include <stdarg.h>
1616 #include <stdlib.h>
1717 #include <string.h>
18+#include <signal.h>
1819 #include <unistd.h>
1920 #include <locale.h>
2021
@@ -272,6 +273,7 @@ static struct menu *current_menu; · 251 unmodified lines
272273 static int child_count;
273274 static int single_menu_mode;
274275 static int show_all_options;
276+static int saved_x, saved_y;
275277
276278 static void conf(struct menu *menu);
277279 static void conf_choice(struct menu *menu);
@@ -792,9 +794,54 @@ static void conf_save(void) · 514 unmodified lines
792794 }
793795 }
794796
797+static int handle_exit(void)
798+{
799+ int res;
800+
801+ dialog_clear();
802+ if (conf_get_changed())
803+ res = dialog_yesno(NULL,
804+ _("Do you wish to save your new configuration ?\n"
805+ "<ESC><ESC> to continue."),
806+ 6, 60);
807+ else
808+ res = -1;
809+
810+ end_dialog(saved_x, saved_y);
811+
812+ switch (res) {
813+ case 0:
814+ if (conf_write(filename)) {
815+ fprintf(stderr, _("\n\n"
816+ "Error while writing of the configuration.\n"
817+ "Your configuration changes were NOT saved."
818+ "\n\n"));
819+ return 1;
820+ }
821+ /* fall through */
822+ case -1:
823+ printf(_("\n\n"
824+ "*** End of the configuration.\n"
825+ "*** Execute 'make' to start the build or try 'make help'."
826+ "\n\n"));
827+ res = 0;
828+ break;
829+ default:
830+ fprintf(stderr, _("\n\n"
831+ "Your configuration changes were NOT saved."
832+ "\n\n"));
833+ }
834+
835+ return res;
836+}
837+
838+static void sig_handler(int signo)
839+{
840+ exit(handle_exit());
841+}
842+
795843 int main(int ac, char **av)
796844 {
797− int saved_x, saved_y;
798845 char *mode;
799846 int res;
800847
@@ -802,6 +849,8 @@ int main(int ac, char **av) · 1 unmodified line
802849 bindtextdomain(PACKAGE, LOCALEDIR);
803850 textdomain(PACKAGE);
804851
852+ signal(SIGINT, sig_handler);
853+
805854 conf_parse(av[1]);
806855 conf_read(NULL);
807856
@@ -823,40 +872,9 @@ int main(int ac, char **av) · 15 unmodified lines
823872 set_config_filename(conf_get_configname());
824873 do {
825874 conf(&rootmenu);
826− dialog_clear();
827− if (conf_get_changed())
828− res = dialog_yesno(NULL,
829− _("Do you wish to save your "
830− "new configuration?\n"
831− "<ESC><ESC> to continue."),
832− 6, 60);
833− else
834− res = -1;
875+ res = handle_exit();
835876 } while (res == KEY_ESC);
836− end_dialog(saved_x, saved_y);
837−
838− switch (res) {
839− case 0:
840− if (conf_write(filename)) {
841− fprintf(stderr, _("\n\n"
842− "Error while writing of the configuration.\n"
843− "Your configuration changes were NOT saved."
844− "\n\n"));
845− return 1;
846− }
847− /* fall through */
848− case -1:
849− printf(_("\n\n"
850− "*** End of the configuration.\n"
851− "*** Execute 'make' to start the build or try 'make help'."
852− "\n\n"));
853− break;
854− default:
855− fprintf(stderr, _("\n\n"
856− "Your configuration changes were NOT saved."
857− "\n\n"));
858− }
859877
860− return 0;
878+ return res;
861879 }
862880
scripts/kconfig/menu.c+5−8
@@ -10,8 +10,7 @@ · 9 unmodified lines
1010
1111 #include "lkc.h"
1212
13−static const char nohelp_text[] = N_(
14− "There is no help available for this option.\n");
13+static const char nohelp_text[] = "There is no help available for this option.";
1514
1615 struct menu rootmenu;
1716 static struct menu **last_entry_ptr;
@@ -595,16 +594,14 @@ struct gstr get_relations_str(struct symbol **sym_arr) · 577 unmodified lines
595594 void menu_get_ext_help(struct menu *menu, struct gstr *help)
596595 {
597596 struct symbol *sym = menu->sym;
597+ const char *help_text = nohelp_text;
598598
599599 if (menu_has_help(menu)) {
600− if (sym->name) {
600+ if (sym->name)
601601 str_printf(help, "%s%s:\n\n", CONFIG_, sym->name);
602− str_append(help, _(menu_get_help(menu)));
603− str_append(help, "\n");
604− }
605− } else {
606− str_append(help, nohelp_text);
602+ help_text = menu_get_help(menu);
607603 }
604+ str_printf(help, "%s\n", _(help_text));
608605 if (sym)
609606 get_symbol_str(help, sym);
610607 }
scripts/kconfig/nconf.c+10−13
@@ -182,8 +182,6 @@ setmod_text[] = N_( · 181 unmodified lines
182182 "This feature depends on another which\n"
183183 "has been configured as a module.\n"
184184 "As a result, this feature will be built as a module."),
185−nohelp_text[] = N_(
186−"There is no help available for this option.\n"),
187185 load_config_text[] = N_(
188186 "Enter the name of the configuration file you wish to load.\n"
189187 "Accept the name shown to restore the configuration you\n"
@@ -280,6 +278,9 @@ static int global_exit; · 90 unmodified lines
280278 /* the currently selected button */
281279 const char *current_instructions = menu_instructions;
282280
281+static char *dialog_input_result;
282+static int dialog_input_result_len;
283+
283284 static void conf(struct menu *menu);
284285 static void conf_choice(struct menu *menu);
285286 static void conf_string(struct menu *menu);
@@ -695,7 +696,6 @@ static void search_conf(void) · 409 unmodified lines
695696 {
696697 struct symbol **sym_arr;
697698 struct gstr res;
698− char dialog_input_result[100];
699699 char *dialog_input;
700700 int dres;
701701 again:
@@ -703,7 +703,7 @@ again: · 1 unmodified line
703703 _("Search Configuration Parameter"),
704704 _("Enter " CONFIG_ " (sub)string to search for "
705705 "(with or without \"" CONFIG_ "\")"),
706− "", dialog_input_result, 99);
706+ "", &dialog_input_result, &dialog_input_result_len);
707707 switch (dres) {
708708 case 0:
709709 break;
@@ -1348,7 +1348,6 @@ static void conf_choice(struct menu *menu) · 638 unmodified lines
13481348 static void conf_string(struct menu *menu)
13491349 {
13501350 const char *prompt = menu_get_prompt(menu);
1351− char dialog_input_result[256];
13521351
13531352 while (1) {
13541353 int res;
@@ -1371,8 +1370,8 @@ static void conf_string(struct menu *menu) · 16 unmodified lines
13711370 prompt ? _(prompt) : _("Main Menu"),
13721371 heading,
13731372 sym_get_string_value(menu->sym),
1374− dialog_input_result,
1375− sizeof(dialog_input_result));
1373+ &dialog_input_result,
1374+ &dialog_input_result_len);
13761375 switch (res) {
13771376 case 0:
13781377 if (sym_set_string_value(menu->sym,
@@ -1392,14 +1391,13 @@ static void conf_string(struct menu *menu) · 13 unmodified lines
13921391
13931392 static void conf_load(void)
13941393 {
1395− char dialog_input_result[256];
13961394 while (1) {
13971395 int res;
13981396 res = dialog_inputbox(main_window,
13991397 NULL, load_config_text,
14001398 filename,
1401− dialog_input_result,
1402− sizeof(dialog_input_result));
1399+ &dialog_input_result,
1400+ &dialog_input_result_len);
14031401 switch (res) {
14041402 case 0:
14051403 if (!dialog_input_result[0])
@@ -1424,14 +1422,13 @@ static void conf_load(void) · 18 unmodified lines
14241422
14251423 static void conf_save(void)
14261424 {
1427− char dialog_input_result[256];
14281425 while (1) {
14291426 int res;
14301427 res = dialog_inputbox(main_window,
14311428 NULL, save_config_text,
14321429 filename,
1433− dialog_input_result,
1434− sizeof(dialog_input_result));
1430+ &dialog_input_result,
1431+ &dialog_input_result_len);
14351432 switch (res) {
14361433 case 0:
14371434 if (!dialog_input_result[0])
scripts/kconfig/nconf.gui.c+47−12
@@ -356,7 +356,7 @@ int btn_dialog(WINDOW *main_window, const char *msg, int btn_num, ...) · 355 unmodified lines
356356
357357 int dialog_inputbox(WINDOW *main_window,
358358 const char *title, const char *prompt,
359− const char *init, char *result, int result_len)
359+ const char *init, char **resultp, int *result_len)
360360 {
361361 int prompt_lines = 0;
362362 int prompt_width = 0;
@@ -367,7 +367,13 @@ int dialog_inputbox(WINDOW *main_window, · 4 unmodified lines
367367 int i, x, y;
368368 int res = -1;
369369 int cursor_position = strlen(init);
370+ int cursor_form_win;
371+ char *result = *resultp;
370372
373+ if (strlen(init)+1 > *result_len) {
374+ *result_len = strlen(init)+1;
375+ *resultp = result = realloc(result, *result_len);
376+ }
371377
372378 /* find the widest line of msg: */
373379 prompt_lines = get_line_no(prompt);
@@ -384,7 +390,7 @@ int dialog_inputbox(WINDOW *main_window, · 10 unmodified lines
384390 y = (LINES-(prompt_lines+4))/2;
385391 x = (COLS-(prompt_width+4))/2;
386392
387− strncpy(result, init, result_len);
393+ strncpy(result, init, *result_len);
388394
389395 /* create the windows */
390396 win = newwin(prompt_lines+6, prompt_width+7, y, x);
@@ -405,7 +411,9 @@ int dialog_inputbox(WINDOW *main_window, · 14 unmodified lines
405411 fill_window(prompt_win, prompt);
406412
407413 mvwprintw(form_win, 0, 0, "%*s", prompt_width, " ");
408− mvwprintw(form_win, 0, 0, "%s", result);
414+ cursor_form_win = min(cursor_position, prompt_width-1);
415+ mvwprintw(form_win, 0, 0, "%s",
416+ result + cursor_position-cursor_form_win);
409417
410418 /* create panels */
411419 panel = new_panel(win);
@@ -431,6 +439,8 @@ int dialog_inputbox(WINDOW *main_window, · 19 unmodified lines
431439 &result[cursor_position],
432440 len-cursor_position+1);
433441 cursor_position--;
442+ cursor_form_win--;
443+ len--;
434444 }
435445 break;
436446 case KEY_DC:
@@ -438,38 +448,63 @@ int dialog_inputbox(WINDOW *main_window, · 1 unmodified line
438448 memmove(&result[cursor_position],
439449 &result[cursor_position+1],
440450 len-cursor_position+1);
451+ len--;
441452 }
442453 break;
443454 case KEY_UP:
444455 case KEY_RIGHT:
445− if (cursor_position < len &&
446− cursor_position < min(result_len, prompt_width))
456+ if (cursor_position < len) {
447457 cursor_position++;
458+ cursor_form_win++;
459+ }
448460 break;
449461 case KEY_DOWN:
450462 case KEY_LEFT:
451− if (cursor_position > 0)
463+ if (cursor_position > 0) {
452464 cursor_position--;
465+ cursor_form_win--;
466+ }
467+ break;
468+ case KEY_HOME:
469+ cursor_position = 0;
470+ cursor_form_win = 0;
471+ break;
472+ case KEY_END:
473+ cursor_position = len;
474+ cursor_form_win = min(cursor_position, prompt_width-1);
453475 break;
454476 default:
455− if ((isgraph(res) || isspace(res)) &&
456− len-2 < result_len) {
477+ if ((isgraph(res) || isspace(res))) {
478+ /* one for new char, one for '\0' */
479+ if (len+2 > *result_len) {
480+ *result_len = len+2;
481+ *resultp = result = realloc(result,
482+ *result_len);
483+ }
457484 /* insert the char at the proper position */
458485 memmove(&result[cursor_position+1],
459486 &result[cursor_position],
460− len+1);
487+ len-cursor_position+1);
461488 result[cursor_position] = res;
462489 cursor_position++;
490+ cursor_form_win++;
491+ len++;
463492 } else {
464− mvprintw(0, 0, "unknow key: %d\n", res);
493+ mvprintw(0, 0, "unknown key: %d\n", res);
465494 }
466495 break;
467496 }
497+ if (cursor_form_win < 0)
498+ cursor_form_win = 0;
499+ else if (cursor_form_win > prompt_width-1)
500+ cursor_form_win = prompt_width-1;
501+
468502 wmove(form_win, 0, 0);
469503 wclrtoeol(form_win);
470504 mvwprintw(form_win, 0, 0, "%*s", prompt_width, " ");
471− mvwprintw(form_win, 0, 0, "%s", result);
472− wmove(form_win, 0, cursor_position);
505+ mvwprintw(form_win, 0, 0, "%s",
506+ result + cursor_position-cursor_form_win);
507+ wmove(form_win, 0, cursor_form_win);
473508 touchwin(win);
474509 refresh_all_windows(main_window);
475510
scripts/kconfig/nconf.h+1−1
@@ -89,7 +89,7 @@ void fill_window(WINDOW *win, const char *text); · 88 unmodified lines
8989 int btn_dialog(WINDOW *main_window, const char *msg, int btn_num, ...);
9090 int dialog_inputbox(WINDOW *main_window,
9191 const char *title, const char *prompt,
92− const char *init, char *result, int result_len);
92+ const char *init, char **resultp, int *result_len);
9393 void refresh_all_windows(WINDOW *main_window);
9494 void show_scroll_win(WINDOW *main_window,
9595 const char *title,
scripts/kconfig/streamline_config.pl+19−3
@@ -43,6 +43,7 @@ · 42 unmodified lines
4343 # make oldconfig
4444 #
4545 use strict;
46+use Getopt::Long;
4647
4748 my $config = ".config";
4849
@@ -112,10 +113,17 @@ sub find_config { · 63 unmodified lines
112113
113114 find_config;
114115
116+# Parse options
117+my $localmodconfig = 0;
118+my $localyesconfig = 0;
119+
120+GetOptions("localmodconfig" => \$localmodconfig,
121+ "localyesconfig" => \$localyesconfig);
122+
115123 # Get the build source and top level Kconfig file (passed in)
116124 my $ksource = $ARGV[0];
117125 my $kconfig = $ARGV[1];
118−my $lsmod_file = $ARGV[2];
126+my $lsmod_file = $ENV{'LSMOD'};
119127
120128 my @makefiles = `find $ksource -name Makefile 2>/dev/null`;
121129 chomp @makefiles;
@@ -296,7 +304,11 @@ my %modules; · 174 unmodified lines
296304
297305 if (defined($lsmod_file)) {
298306 if ( ! -f $lsmod_file) {
299− die "$lsmod_file not found";
307+ if ( -f $ENV{'objtree'}."/".$lsmod_file) {
308+ $lsmod_file = $ENV{'objtree'}."/".$lsmod_file;
309+ } else {
310+ die "$lsmod_file not found";
311+ }
300312 }
301313 if ( -x $lsmod_file) {
302314 # the file is executable, run it
@@ -421,7 +433,11 @@ while(<CIN>) { · 118 unmodified lines
421433
422434 if (/^(CONFIG.*)=(m|y)/) {
423435 if (defined($configs{$1})) {
424− $setconfigs{$1} = $2;
436+ if ($localyesconfig) {
437+ $setconfigs{$1} = 'y';
438+ } else {
439+ $setconfigs{$1} = $2;
440+ }
425441 } elsif ($2 eq "m") {
426442 print "# $1 is not set\n";
427443 next;
scripts/mod/file2alias.c+25−0
@@ -735,6 +735,27 @@ static int do_virtio_entry(const char *filename, struct virtio_device_id *id, · 734 unmodified lines
735735 return 1;
736736 }
737737
738+/*
739+ * Looks like: vmbus:guid
740+ * Each byte of the guid will be represented by two hex characters
741+ * in the name.
742+ */
743+
744+static int do_vmbus_entry(const char *filename, struct hv_vmbus_device_id *id,
745+ char *alias)
746+{
747+ int i;
748+ char guid_name[((sizeof(id->guid) + 1)) * 2];
749+
750+ for (i = 0; i < (sizeof(id->guid) * 2); i += 2)
751+ sprintf(&guid_name[i], "%02x", id->guid[i/2]);
752+
753+ strcpy(alias, "vmbus:");
754+ strcat(alias, guid_name);
755+
756+ return 1;
757+}
758+
738759 /* Looks like: i2c:S */
739760 static int do_i2c_entry(const char *filename, struct i2c_device_id *id,
740761 char *alias)
@@ -994,6 +1015,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, · 253 unmodified lines
9941015 do_table(symval, sym->st_size,
9951016 sizeof(struct virtio_device_id), "virtio",
9961017 do_virtio_entry, mod);
1018+ else if (sym_is(symname, "__mod_vmbus_device_table"))
1019+ do_table(symval, sym->st_size,
1020+ sizeof(struct hv_vmbus_device_id), "vmbus",
1021+ do_vmbus_entry, mod);
9971022 else if (sym_is(symname, "__mod_i2c_device_table"))
9981023 do_table(symval, sym->st_size,
9991024 sizeof(struct i2c_device_id), "i2c",
scripts/mod/modpost.c+7−0
@@ -1849,6 +1849,12 @@ static void add_header(struct buffer *b, struct module *mod) · 1848 unmodified lines
18491849 buf_printf(b, "};\n");
18501850 }
18511851
1852+static void add_intree_flag(struct buffer *b, int is_intree)
1853+{
1854+ if (is_intree)
1855+ buf_printf(b, "\nMODULE_INFO(intree, \"Y\");\n");
1856+}
1857+
18521858 static void add_staging_flag(struct buffer *b, const char *name)
18531859 {
18541860 static const char *staging_dir = "drivers/staging";
@@ -2169,6 +2175,7 @@ int main(int argc, char **argv) · 314 unmodified lines
21692175 buf.pos = 0;
21702176
21712177 add_header(&buf, mod);
2178+ add_intree_flag(&buf, !external_module);
21722179 add_staging_flag(&buf, mod->name);
21732180 err |= add_versions(&buf, mod);
21742181 add_depends(&buf, mod, modules);
scripts/tags.sh+2−2
@@ -129,7 +129,7 @@ exuberant() · 128 unmodified lines
129129 -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
130130 -I DEFINE_TRACE,EXPORT_TRACEPOINT_SYMBOL,EXPORT_TRACEPOINT_SYMBOL_GPL \
131131 --extra=+f --c-kinds=+px \
132− --regex-asm='/^ENTRY\(([^)]*)\).*/\1/' \
132+ --regex-asm='/^(ENTRY|_GLOBAL)\(([^)]*)\).*/\2/' \
133133 --regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' \
134134 --regex-c++='/^TRACE_EVENT\(([^,)]*).*/trace_\1/' \
135135 --regex-c++='/^DEFINE_EVENT\([^,)]*, *([^,)]*).*/trace_\1/'
@@ -151,7 +151,7 @@ exuberant() · 15 unmodified lines
151151 emacs()
152152 {
153153 all_sources | xargs $1 -a \
154− --regex='/^ENTRY(\([^)]*\)).*/\1/' \
154+ --regex='/^(ENTRY|_GLOBAL)(\([^)]*\)).*/\2/' \
155155 --regex='/^SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/sys_\1/' \
156156 --regex='/^TRACE_EVENT(\([^,)]*\).*/trace_\1/' \
157157 --regex='/^DEFINE_EVENT([^,)]*, *\([^,)]*\).*/trace_\1/'