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

Unused type declarations should be removed

    Details

    • Message:
      Remove the unused declaration of type "xxx".
    • Default Severity:
      Major
    • Impact:
      Low
    • Likelihood:
      High
    • Default Quality Profiles:
      Sonar way, MISRA C++ 2008 recommended
    • Covered Languages:
      C, C++, Objective-C
    • Remediation Function:
      Constant/Issue
    • Constant Cost:
      10min
    • MISRA C++ 2008:
      0-1-5

      Description

      If a type is declared but not used, then it is unclear to a reviewer if the type is redundant or it has been left unused by mistake.

      Noncompliant Code Example

      void unusedtype()
      {
        typedef int local_Type; // Noncompliant, unused
      }
      

      See

      • MISRA C++:2008, 0-1-5 - A project shall not contain unused type declarations.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                Anonymous
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: