Skip to content

Function definition in macro => mismatched end line #192

@alkino

Description

@alkino

With this simple sample:

#define FOO void bar() {}; void foo() 

FOO {
}

int main() {
    return 0;
}

And this compilation line:

g++ -coverage main.cpp && lcov --initial --capture  --directory . --output-file coverage-base.info

I got this error:

Capturing coverage data from .
geninfo cmd: '/usr/bin/geninfo . --output-filename coverage-base.info --initial --parallel 1 --memory 0'
Found gcov version: 12.2.1
Using intermediate gcov format
Writing temporary data to /tmp/geninfo_datGRDd
Scanning . for .gcno files ...
Found 2 graph files in .
Processing ./foo-main.gcno
Processing ./a-main.gcno
geninfo: Error: mismatched end line for _Z3barv at /home/alkino/TEST/main.cpp:3: 4 -> 3
	(use "geninfo --ignore-errors mismatch ..." to bypass this error)
geninfo: cannot remove path when cwd is /tmp/geninfo_datGRDd/geninfo_Z6iKx for /tmp/geninfo_datGRDd/geninfo_Z6iKx:  at /usr/share/perl5/core_perl/File/Temp.pm line 2643.
geninfo: cannot remove path when cwd is /tmp/geninfo_datGRDd/geninfo_Z6iKx for /tmp/geninfo_datGRDd:  at /usr/share/perl5/core_perl/File/Temp.pm line 2643.

I think there is 2 errors here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions