Community
Participate
Working Groups
Using CDT master as of today. 1. Create an executable, hello world C++ project with this code: #include <iostream> using namespace std; int main() { cout << "!!!Hello World!!!" << endl; // prints MACRO // this will be a syntax error } 2. Open the project properties, C/C++ General, Settings. 3. Under (GCC) C++ Compiler, Preprocessor, add the symbol MACRO='return 0;' 4. Click OK. In the file, the MACRO line is marked as a syntax error, but this compiles properly (with GCC at least). I kept the title of the bug as a specific case because I don't actually know at what stage this should be handled. What I mean is that the macro could be unquoted before being passed to the preprocessor or the preprocessor could do the unquoting. Here are a few flows that the macros go through: 1) managed build settings -> managed build language settings -> CDT preprocessor 2) managed build settings -> build (invocke gcc -D...) 3) build output parser -> output parser language settings -> CDT preprocessor For #2 to work, as of today, you have to keep the quotes. As part of bug 463723, I was working on a specific problem of #3, where a quoted macro was not being read correctly by the output parser. But then passing this to the preprocessor as-is doesn't work properly and this is also the case for #1 (as shown in the steps). So there needs to be a common place where to handle removing the quotes, either at the preprocessor stage, or somewhere before that.