Feedback
Line numbers in preprocessed code are not matching up with lines in original one.
When we have a souce code, especially with some more complex #define directive (see test.cpp in attached zipfile), the line numbers in this source file and line numbers in preprocessor's output are not matching: it is impossible to correlate certain line in preprocessor's output with similar line in original source basing on #line directives in preprocessed code. Was able to reproduce in following compilers:
- Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50215.44 for 80x86
- Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
- Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.00.9466 for 80x86
Open test.cpp (from attached .zip file), and run it collecting preprocessor output to a file (by adding /P flag to project options, eg. "cl.exe /P test.cpp"). Check the output file (test.i) and you'll see that line numbers are no longer correct - they have changed their position compared to original ones.
#line 1 "test.cpp"
void test(int i, int j, int k) {}
int main()
{
{ { test(10, 20, 2); } }
return 0; //line 16, should be 19 (see test.cpp)
}
#line 1 "test.cpp"
void test(int i, int j, int k) {}
int main()
{
{ { test(10, 20, 2); } }
return 0; //line 19, as is supposed to be
}