You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compiler Is not involved, it's a message you see while you hover with the mouse on the macro name. It's a parser/indexer Eclipse message.
15knots
changed the title
String not correctly parsed in Eclipse
String literal macro value not correctly parsed from compile_commands.json
May 11, 2020
I can see that the vaule of FOO_VERSIOn comes in as \"01.00-1\".
Should be "01.00-1".
So either the json parser is buggy or the generated compile_commands.json .
Consider a very simple project with a CMakeLists.txt file:
cmake_minimum_required(VERSION 2.8)
set(MY_VERSION 01.00)
set(MY_MINOR_VERSION 1)
set(MY_COMP ${MY_VERSION}-${MY_MINOR_VERSION})
cmake_policy(SET CMP0048 NEW)
project(FOO CXX)
add_executable(FOO main.cpp)
add_definitions(-DFOO_VERSION="${MY_COMP}")
In the compile_commands.json I see with three slashes:
-DFOO_VERSION=\"01.00-1\"
In Eclipse I see
int main() {
std::cout << FOO_VERSION << std::endl; <------Bad character sequence encountered:
return 0;
}
So it seems when the macro is parsed in Eclipse an extra slash is taken into account. No problem executing the simple program.
The text was updated successfully, but these errors were encountered: