Uploaded image for project: 'SonarCFamily'
  1. SonarCFamily
  2. CPP-2381

S139: Fix false-positive with comments after curly braces and preprocessor directives

    Details

    • Type: False-Positive
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.12
    • Component/s: C, C++, Objective-C
    • Labels:
      None

      Description

      Open and close curly braces should be an exception. For namespaces this is a common pattern:

      namespace A {
      ....
      } // A
      

      We also should not raise after preprocessor directives:

      #if defined(_WIN32)
      ...
      #endif // defined(_WIN32)
      

      Please add this exception to the RSPEC when ticket is handled

        Attachments

        1. S139.PNG
          S139.PNG
          16 kB
        2. S139(2).PNG
          S139(2).PNG
          42 kB

          Issue Links

            Activity

              People

              • Assignee:
                gyula.sallai Gyula Sallai
                Reporter:
                abbas.sabra Abbas Sabra
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: