Uploaded image for project: 'Rules Repository'
  1. Rules Repository
  2. RSPEC-2754

Declarations should not be empty

    XMLWordPrintable

    Details

    • Type: Code Smell Detection
    • Status: Active
    • Resolution: Unresolved
    • Labels:
    • Message:
      Remove this empty declaration.
    • Default Severity:
      Minor
    • Impact:
      Low
    • Likelihood:
      Low
    • Default Quality Profiles:
      Sonar way, MISRA C++ 2008 recommended
    • Covered Languages:
      C, C++, Objective-C
    • Remediation Function:
      Constant/Issue
    • Constant Cost:
      2min
    • CERT:
      MSC12-C.
    • PC-Lint:
      19, 1019

      Description

      Empty declarations are cruft; they (may) compile, but they violate the language standards, don't contribute anything of value, and clutter up the program. Like cobwebs, they should be swept away.

      Noncompliant Code Example

      int;  // Noncompliant
      

      See

      • ISO/IEC 9899:2011, 6.7p2
      • ISO/IEC 14882:2011, 7p3.
      • CERT, MSC12-C. - Detect and remove code that has no effect or is never executed

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              ann.campbell.2 Ann Campbell
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: