kbuild: genksyms fix for typeof handling

The tokenizer misses counting an open-parenthesis when parsing a
non-trivial typeof beginning with an open-parenthesis. This function
in include/linux/ceph/libceph.h

static type *lookup_##name(struct rb_root *root,
                           typeof(((type *)0)->keyfld) key)

When instantiated in net/ceph/mon_client.c, causes subsequent symbols
including an EXPORT_SYMBOL in that file to be lost.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
This commit is contained in:
Nicholas Piggin 2016-08-25 19:53:08 +10:00 committed by Michal Marek
parent dee81e9886
commit 4fab91605a
1 changed files with 17 additions and 18 deletions

View File

@ -289,6 +289,23 @@ repeat:
} }
break; break;
case ST_TYPEOF_1:
if (token == IDENT)
{
if (is_reserved_word(yytext, yyleng)
|| find_symbol(yytext, SYM_TYPEDEF, 1))
{
yyless(0);
unput('(');
lexstate = ST_NORMAL;
token = TYPEOF_KEYW;
break;
}
_APP("(", 1);
}
lexstate = ST_TYPEOF;
/* FALLTHRU */
case ST_TYPEOF: case ST_TYPEOF:
switch (token) switch (token)
{ {
@ -313,24 +330,6 @@ repeat:
} }
break; break;
case ST_TYPEOF_1:
if (token == IDENT)
{
if (is_reserved_word(yytext, yyleng)
|| find_symbol(yytext, SYM_TYPEDEF, 1))
{
yyless(0);
unput('(');
lexstate = ST_NORMAL;
token = TYPEOF_KEYW;
break;
}
_APP("(", 1);
}
APP;
lexstate = ST_TYPEOF;
goto repeat;
case ST_BRACKET: case ST_BRACKET:
APP; APP;
switch (token) switch (token)