Details
-
Bug
-
Resolution: Done
-
P2: Important
-
Qt Creator 4.2.0
Description
When using cmake based projects with add_definitions(-DFOO) where no value is defined, Qt Creator seems to add "#define FOO" instead of "define FOO 1" into macro definitions used for code highlighting.
"-D" is documented here
https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html#Preprocessor-Options
and here:
https://msdn.microsoft.com/en-us/library/hhzbb5c8.aspx
This breaks code highlighting for cases like this:
#if FOO
(...)
#endif
Statically analyzing the code I think bug is in cmakecbpparser.cpp:void CMakeCbpParser::parseAdd()
Now (taken from latest git, not 4.2.0):
if (macroNameIndex != 1)
I think it should be:
if (macroNameIndex != 1)
Attachments
For Gerrit Dashboard: QTCREATORBUG-17915 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
184003,19 | Convert macros from plain QByteArray to a vector of structs | master | qt-creator/qt-creator | Status: MERGED | -2 | 0 |