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

Fix false-positives in S836 (UseOfUninitializedVariableCheck)

    XMLWordPrintable

    Details

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

      Description

      False positive probably due to bad semantic resolution:

      enum Types {
        TypeA,
        TypeB
      };
      bool init(bool p1, bool &p2,         Types p3,        bool p4 = false);
      bool init(bool p1, Types p2 = TypeA, bool p3 = false);
      
      void testfp() {
        bool flag;
        init(false, flag, TypeB);
      }
      

        Attachments

          Activity

            People

            Assignee:
            loic.joly Loïc Joly
            Reporter:
            massimo.paladin Massimo PALADIN
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: