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

S836: Fix false-positives

    XMLWordPrintable

    Details

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

      Description

      RSPEC-836
      We don't track static local variables as they could change between multiple function executions:

      void fp_002() {
        int a, b;
        static int staticflag = 100;
        if (staticflag == 100) {
          a = 8;
        }
        b = a;  // FP raised here
      }
      

        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: