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

S1763 should stop raising an issue in case of labeled statements after a jump

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.0
    • Component/s: Rules
    • Labels:
      None

      Description

      RSPEC-1763 has been slightly updated and the rule is not supposed anymore to raise an issue in case of labelled statements located after a jump statement.

      void foo(int a) {
        if (a == 5) {
          goto error;
        } else {
          // do the job
        }
        return;
        
        error: 
          printf("don't use 5"); // this is reachable but unreadable
      }
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            freddy.mallet Freddy Mallet (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: