View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0010872KWStylepublic2010-06-24 16:392010-06-25 11:02
ReporterBrad Davis 
Assigned ToBrad Davis 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Summary0010872: Comment symbols in strings (i.e., not comments) are parsed incorrectly as comments
DescriptionMuch of the style checking is done on the buffer m_BufferNoComment.

This buffer contained the text of the file but with all comments removed.

The algorithm for removing the comments was flawed in the following sense: comment-ish strings within double quotes were incorrectly interpreted as comments.

I have added a test that reveals the problem and a fix and will soon push this fix (once I have a mantis number).
Additional InformationHere is an example that will trigger problems:


A()
{
  f("//");
}

B()
{
  g("//");
}

C()
{
}
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0021166)
Brad Davis (manager)
2010-06-25 09:08

Patch is pending access to git repo.
(0021170)
Brad Davis (manager)
2010-06-25 10:27

Author: Brad Davis <brad.davis@kitware.com> 2010-06-24 16:44:31
Committer: Brad Davis <brad.davis@kitware.com> 2010-06-25 10:27:09
Parent: 9b5163c00ca6784f362151960ba700f5d23134a8 (KWSys Nightly Date Stamp)
Branches: master, remotes/origin/master
Follows:
Precedes:

    BUG: refs 0010872; fix parsing of comments in strings
    
    Comment-ish symbols like // and /* were incorrectly being looked for
    inside strings (e.g., "//"). This led to multiple problems since much
    kwsytle processing happens on a buffer with the comments stripped
    away.
    
    E.g.,
    
    f("//");
    
    was being checked as
    
    f("
(0021171)
Brad Davis (manager)
2010-06-25 10:29

Need to get stronger mantis permissions to mark this as resolved.

 Issue History
Date Modified Username Field Change
2010-06-24 16:39 Brad Davis New Issue
2010-06-25 09:08 Brad Davis Note Added: 0021166
2010-06-25 10:27 Brad Davis Note Added: 0021170
2010-06-25 10:29 Brad Davis Note Added: 0021171
2010-06-25 11:02 Brad Davis Status new => resolved
2010-06-25 11:02 Brad Davis Resolution open => fixed
2010-06-25 11:02 Brad Davis Assigned To => Brad Davis


Copyright © 2000 - 2018 MantisBT Team