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
Line numbers wrong after conditional section #24
Comments
This looks like a problem in wave. It shouldn't remove the directives without leaving an empty line or adding an additional #line directive. |
Ok, this is definitely a problem.
produces :
so there is no way to find the initial line number. I'll try to correct it. |
I believe the following condition wave/include/boost/wave/util/cpp_iterator.hpp Line 535 in cad8f03
|
Normally, the wave library inserts either a single empty line or a |
Hi @hkaiser , I may have miss something then... It doesn't for me. Could you test the above pseudo-code to confirm that it behave as you think ? Thanks |
I can confirm that I see the problem as well. |
@hkaiser I just realized (thanks to your other answer about preserving comment) that I need to use
and then the current problem is solved in the way you say. GREAT !! |
This is still a problem requiring investigation. You found a mode where it doesn't happen, but your example should produce the correct answer in any case. |
I'm really impressed by this library, it is quiet difficult to use it and I found the documentation a bit too short (especially about "language_support" and all the options..). But it definitely worth to spend time to understand it because it is by far, the best open source preprocessor library. Many thanks for sharing your knowledge and for your work ! |
Ok so I'm living this issue open. At least for the moment I can use this trick. |
UPDATE : Unfortunately it doesn't really works : when the macro statement is part of a file that is included, even those if I use :
there is no blank line or emitted line . Example : FILE : main.c : FILE : file_with_macro.h :
The output of the preprocessing apply to main.c produces :
So it seems that there is a problem with macro and emitted lines. |
Using the wave tool on the included file alone demonstrates that the line numbers are wrong. The |
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 :
is (B) :
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 :
(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.
The text was updated successfully, but these errors were encountered: