#273 Incorrenct processing of macros with arguments

None
closed-invalid
5
2013-06-26
2012-07-18
Denis
No

For macros such as (examples from linux kernel)
(http://lxr.linux.no/linux+*/include/linux/compiler-gcc.h#L90)
#define __printf(a, b) __attribute__((format(printf, a, b)))
#define __scanf(a, b) __attribute__((format(scanf, a, b)))
or
# define __acquires(x) __attribute__((context(x,0,1)))
# define __releases(x) __attribute__((context(x,1,0)))
(http://lxr.linux.no/linux+*/include/linux/compiler.h#L13)

wrong index is generated. Because these macros are placed in functions definitions/declarations and lexer obviously thinks that this is function name, but not a macro.

Examples of invocation:
static void prepare_set(void) __acquires(set_atomicity_lock)
{
...
}
static void post_set(void) __releases(set_atomicity_lock)
{
...
}

static void __printf(3, 4) link_debug(struct Channel *chanp, int direction, char *fmt, ...)
{
...
}

Discussion

  • This has nothing to do with those things being macros. It's the functions definitions themselves that don't scan, because they violate a documented limitation of the tool. See "man cscope", the first few paragraphs of the "Notices" section. As such, this is no bug.

     
    • status: open --> pending-invalid
     
    • status: pending-invalid --> closed-invalid
    • Group: -->