Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#1986 closed defect (invalid)

Wrong Warning about usage of variable before defined

Reported by: Jens Frenkel Owned by: Martin Sjölund
Priority: normal Milestone: 1.9.0
Component: Frontend Version: trunk
Keywords: Warning Cc:

Description

For the model Modelica.Electrical.Spice3.Examples.Graetz following warning was reported

[Modelica 3.2.1/Electrical/Spice3.mo:10296:9-10308:28:writable] Warning: m_dCurrent was used before it was defined (given a value). Additional such uses may exist for the variable, but some messages were suppressed.

However in the named line of Modelica Code "m_dCurrent" is assigned inside an if equation.

        if (in_p.m_pBvIsGiven > 0.5) then
          (out_cc.m_dCurrent,m_dCond) :=
            Modelica.Electrical.Spice3.Internal.Functions.junction3(
                  m_dPNVoltage,
                  in_m.m_dTemp,
                  in_p.m_emissionCoeff,
                  in_c.m_tSatCur,
                  in_c.m_tBrkdwnV);
        else
          (out_cc.m_dCurrent,m_dCond) :=
            Modelica.Electrical.Spice3.Internal.Functions.junction2(
                  m_dPNVoltage,
                  in_m.m_dTemp,
                  in_p.m_emissionCoeff,
                  in_c.m_tSatCur);
        end if;

        (m_dCap,m_dCharge) :=
          Modelica.Electrical.Spice3.Internal.Functions.junctionCapTransTime(
                in_c.m_tJctCap,
                m_dPNVoltage,
                in_c.m_tJctPot*in_p.m_depletionCapCoeff,
                in_p.m_gradingCoeff,
                in_p.m_junctionPot,
                in_c.m_tF1,
                in_c.m_f2,
                in_c.m_f3,
                in_p.m_transitTime,
                m_dCond,
                m_dCurrent);

Change History (2)

comment:1 by Jens Frenkel, 12 years ago

Resolution: invalid
Status: newclosed

comment:2 by Jens Frenkel, 12 years ago

Note: See TracTickets for help on using tickets.