Author Topic: VC compiler, to find why the CC is not working  (Read 7275 times)

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
VC compiler, to find why the CC is not working
« on: September 07, 2009, 09:54:35 am »
Hello everyone! I have the following tests are based on branches / codecompletion_refactoring / a SVN5741 version. Glad to see CC's latest development!

With regard to CC does not support the VC header files, I find the reasons for a bit and found that:
The test file is VC's stdio.h, I find this code is the reason!
Code
#ifdef  _POSIX_
#define _P_tmpdir   "/"
#define _wP_tmpdir  L"/"
#else
#define _P_tmpdir2   "\"
#define _wP_tmpdir2  L"\\"
#endif

LOG is as follows:
Quote
Reparsing saved files ...
Starting batch parsing
Parsing stage done (31 total parsed files, 3575 tokens in 0 minute (s), 0.0 seconds).
Updating class browser ...
Class browser updated.


When remove this code, then the CC is working properly, this time LOG are as follows:
Quote
Reparsing saved files ...
Starting batch parsing
Parsing stage done (31 total parsed files, 3945 tokens in 0 minute (s), 0.16 seconds).
Updating class browser ...
Class browser updated.


Among them, a key factor is:
Code
#ifdef  _POSIX_
#define _P_tmpdir2   "\"
#define _wP_tmpdir2  L"\\"
These two lines of code, if changed:
Code
#ifdef  _POSIX_
#define _P_tmpdir2   "/"
#define _wP_tmpdir2  L"//"
This time LOG are as follows, CC work well:
Quote
Reparsing saved files ...
Starting batch parsing
Parsing stage done (31 total parsed files, 3945 tokens in 0 minute (s), 0.16 seconds).
Updating class browser ...
Class browser updated.


This shows that the CC on the "\\" analytic serious bug, urge restoration, thank you!

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: VC compiler, to find why the CC is not working
« Reply #1 on: September 07, 2009, 11:02:40 am »
It seems in my local copy, I can't reproduce this bug.
See the screen shot.


[attachment deleted by admin]
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.