User forums > General (but related to Code::Blocks)

Code parser sucks for macros followed by C-style comments

(1/1)

wofun:
The code parser which creates the symbol database sucks if a macro declaration is followed by a C-style comment:

#define AAA whatever   /* comment#1 */
#define BBB whatever   /* comment#2 */

#define CCC whatever   /* comment#3 */

The symbol browser shows a single entry for AAA which spans the declaration of AAA and BBB.
The symbol BBB is not resolved ("go to declaration" sucks).
The symbol CCC is OK again.

No need to tell that this is more than annoying.

Seems as if the C-style comment is accidentally interpreted as line continuation.
Seems as if the empty line forces a new item.

I think this should be a pretty well known issue but the search function does not find something useful in the bug database. Should I write a new bug report? Would have to create an account just for that...

wofun:
Btw:
Same behavior on 8.02 and 10.05
Same behavior on Linux and Windows.

oBFusCATed:
C::B do not support (well/at all) parsing of marcos and templates.
There is some work going on in a separate branch, but it is not ready for the general public.

ollydbg:

--- Quote from: wofun on July 02, 2010, 10:53:19 am ---The code parser which creates the symbol database sucks if a macro declaration is followed by a C-style comment:

#define AAA whatever   /* comment#1 */
#define BBB whatever   /* comment#2 */

#define CCC whatever   /* comment#3 */

The symbol browser shows a single entry for AAA which spans the declaration of AAA and BBB.
The symbol BBB is not resolved ("go to declaration" sucks).
The symbol CCC is OK again.

No need to tell that this is more than annoying.

Seems as if the C-style comment is accidentally interpreted as line continuation.
Seems as if the empty line forces a new item.

I think this should be a pretty well known issue but the search function does not find something useful in the bug database. Should I write a new bug report? Would have to create an account just for that...

--- End quote ---

I will check it. I think it is not a big bug.

By the way. There is a branch about CodeCompletion in SVN repo, Someone(include me) were try to improve the Macro handling and Macro expansion.

ollydbg:
I just test the code in CC_BRANCH's parsertest project.


--- Code: ---#define AAA whatever   /* comment#1 */
#define BBB whatever   /* comment#2 */

#define CCC whatever   /* comment#3 */

--- End code ---

It seems it works fine, see the log:

--- Code: -----------------T-r-e-e--L-o-g--------------

000046. #define AAA whatever [9,9]
000047. #define BBB whatever [10,10]
000048. #define CCC whatever [12,12]


--------------L-i-s-t--L-o-g--------------

000049. preprocessor #define AAA whatever [9,9]
000050. preprocessor #define BBB whatever [10,10]
000051. preprocessor #define CCC whatever [12,12]
--- End code ---

Navigation

[0] Message Index

Go to full version