Share

cloc

Tracker: Bugs

5 Serious bug in comment removing - ID: 2839516
Last Update: Settings changed ( alnd )

When I test the cloc program, I faced some major problem.
Explanation:
I did the example program as follows.

int main()
{
printf("test \
//Testing//" );
}

After using the colc with options --strip-comments=c . I got new file
called a.c.c . Please refer the output.
int main()
{
printf("test
}

Anyone explain is this right ?

In this case, it should not remove the "//" which is surrounded on the
double quotes. This problem I faced in ruby program also. Please anybody
help me on this .


cloc S ( cloc ) - 2009-08-18 10:22

5

Closed

Wont Fix

Nobody/Anonymous

filters

None

Public


Comment ( 1 )

Date: 2009-08-19 05:25
Sender: alndProject Admin

As explained at http://cloc.sourceforge.net/#Limitations item #2, cloc is
unable to figure out that comment markers within strings should be ignored.
If you were to replace the // markers with text that does not start or end
a C comment, then it will work as desired.


Attached File

No Files Currently Attached

Changes ( 5 )

Field Old Value Date By
status_id Open 2009-08-19 05:25 alnd
resolution_id None 2009-08-19 05:25 alnd
category_id None 2009-08-19 05:25 alnd
allow_comments 1 2009-08-19 05:25 alnd
close_date - 2009-08-19 05:25 alnd