Skip to content
Snippets Groups Projects
Commit a23d4c2f authored by Masahiro Yamada's avatar Masahiro Yamada
Browse files

genksyms: fix syntax error for attribute before init-declarator


A longstanding issue with genksyms is that it has hidden syntax errors.

For example, genksyms fails to parse the following valid code:

    int x, __attribute__((__section__(".init.data")))y;

Here, only 'y' is annotated by the attribute, although I am not aware
of actual uses of this pattern in the kernel tree.

When a syntax error occurs, yyerror() is called. However,
error_with_pos() is a no-op unless the -w option is provided.

You can observe syntax errors by manually passing the -w option.

    $ echo 'int x, __attribute__((__section__(".init.data")))y;' | scripts/genksyms/genksyms -w
    <stdin>:1: syntax error

This commit allows attributes to be placed between a comma and
init_declarator.

Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
Acked-by: default avatarNicolas Schier <n.schier@avm.de>
parent c8258405
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment