Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPreprocessor,C: macro expands multiple lines #4018

Open
kcwu opened this issue Jun 13, 2024 · 1 comment
Open

CPreprocessor,C: macro expands multiple lines #4018

kcwu opened this issue Jun 13, 2024 · 1 comment

Comments

@kcwu
Copy link

kcwu commented Jun 13, 2024

The name of the parser: C

The command line you used to run ctags:

$ ctags --options=NONE -D 'SYSCALL_DEFINE3(name,...)=long name(__VA_ARGS__)'   open.c

open.c is extracted from linux kernel
https://elixir.bootlin.com/linux/latest/source/fs/open.c#L714

The content of input file:

SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode)
{
        return do_faccessat(dfd, filename, mode, 0);
}

SYSCALL_DEFINE3(fchmodat, int, dfd, const char __user *, filename,
                umode_t, mode)
{
        return do_fchmodat(dfd, filename, mode, 0);
}

The tags output you are not satisfied with:

faccessat       open.c  /^SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode)$/;"    f       typeref:typename:long
fchmodat        open.c  /^              umode_t, mode)$/;"      f       typeref:typename:long

The tags output you expect:

faccessat       open.c  /^SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode)$/;"    f       typeref:typename:long
fchmodat        open.c  /^SYSCALL_DEFINE3(fchmodat, int, dfd, const char __user *, filename,/;"      f       typeref:typename:long

The version of ctags:

$ ctags --version
Universal Ctags 6.1.0(p6.1.20240609.0), Copyright (C) 2015-2023 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  Compiled: Jun 13 2024, 15:18:36
  URL: https://ctags.io/
  Output version: 0.0
  Optional compiled features: +wildcards, +regex, +iconv, +option-directory, +xpath, +packcc, +optscript, +pcre2

How do you get ctags binary:

Building it locally from master branch today.

@masatake masatake changed the title Macro expands multiple lines CPreprocessor,C: macro expands multiple lines Jun 13, 2024
@masatake
Copy link
Member

It looks hard to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants