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

Fix false-positive in S1854 (DeadStoreCheck)

    XMLWordPrintable

    Details

    • Type: False-Positive
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.0
    • Component/s: C, C++, Rules
    • Labels:
      None

      Description

      struct S1 {
        int f;
      } s1;
      
      void fp() {
        // issue raised on the following assignment but s2 is used in nested instance initialization
        struct S1 s2 = s1;
      
        struct S1 nested = {
          .f = s2.f
        };
        nested;
      }
      

        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

              Created:
              Updated:
              Resolved: