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

Fix false-positives in UnusedLocalVariableCheck (S1481)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.10
    • Fix Version/s: 3.11
    • Component/s: C, Rules
    • Labels:
      None

      Description

      struct A {
        int x;
      };
      
      void struc() {
        int val = 5; // issue raised here: false positive!
        const struct A sa = // Noncompliant
          { .x = val };
      

        Attachments

          Activity

            People

            Assignee:
            massimo.paladin Massimo PALADIN
            Reporter:
            massimo.paladin Massimo PALADIN
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: