Skip to content

Line numbers wrong after conditional section #24

@malickf

Description

@malickf

I have a small problem and I don't know if this can be easily fixed in wave.

I'm using wave to preprocess a file. It correctly handles macro.
For instance , output of the following code :

#define DEBUG

MyClass::Test()
{
#ifdef DEBUG
	print("Test");
#endif
    this.Test();
}
 

is (B) :

#line 3 "C:\.....\myfile.c"
MyClass::Test()
{
	print("Test");
    this.Test();
}
 

Then I apply a home-made linter to the preprocessed file (B) . However, I'm struggling to identify the initial line number from the preprocessed file.

Is there a way to get more information in the preprocessed file, something similar to :

#line 3 "...myfile.c"
MyClass::Test()
{
#line 6 "...myfile.c"
	print("Test");
#line 8 "...myfile.c"
    this.Test();
}

(or any other methods that permits to find the initial line number when macro is used .
Don't hesitate to tell me if I'm not clear enough.

Many thanks.

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