summaryrefslogtreecommitdiff
path: root/scripts/clang-tools/gen_compile_commands.py
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2025-01-13 18:00:55 +0300
committerMasahiro Yamada <masahiroy@kernel.org>2025-01-27 01:44:16 +0300
commita23d4c2f5b80a8dc5f1e40658abbe5983af1a0e9 (patch)
tree3e404c91ac4d14f4c0c2e15b34fdf792aeee390b /scripts/clang-tools/gen_compile_commands.py
parentc825840527813582385edca3ddeee46886527258 (diff)
downloadlinux-a23d4c2f5b80a8dc5f1e40658abbe5983af1a0e9.tar.xz
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: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Nicolas Schier <n.schier@avm.de>
Diffstat (limited to 'scripts/clang-tools/gen_compile_commands.py')
0 files changed, 0 insertions, 0 deletions