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

New rule: Do not indent preprocessor directives

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: 1.5
    • Component/s: Rules
    • Labels:
      None

      Description

      See http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#General_Naming_Rules

      "The hash mark that starts a preprocessor directive should always be at the beginning of the line. "

      // Bad - indented directives
        if (lopsided_score) {
          #if DISASTER_PENDING  // Wrong!  The "#if" should be at beginning of line
          DropEverything();
          #endif                // Wrong!  Do not indent "#endif"
          BackToNormal();
        }
      

        Attachments

          Activity

            People

            • Assignee:
              dinesh.bolkensteyn Dinesh Bolkensteyn (Inactive)
              Reporter:
              dinesh.bolkensteyn Dinesh Bolkensteyn (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: