Re: potentially uninitialized local variables in Analytic GJR-GARCH(1, 1) Engine

Posted by Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/potentially-uninitialized-local-variables-in-Analytic-GJR-GARCH-1-1-Engine-tp12134p12137.html

On Fri, 2009-11-27 at 12:56 +0100, Ferdinando Ametrano wrote:

> On Fri, Nov 27, 2009 at 12:30 PM, Luigi Ballabio
> > The variables above are all initialized one way or the other in a
> > section of code that reads:
> >
> > if (init_ != true || constants_match != true || ...) {
> >    ... the variables are initialized to some values ...
> > }
> > else if (init_ == true && constants_match == true) {
> >    ... the variables are initialized to some other values ...
> > }
>
> mmm... it seems to me the condition you summarized as "..." might
> really imply some other logic branch where variables are not
> initialized.

No. If either init or constants_match is false, the code takes the first
branch (it's an or, so one suffices.) If not, either the conditions in
"..." are true (and the code takes the first branch) or, since init and
constant_match are both true, it takes the second branch.

Luigi


--

Things should be made as simple as possible, but no simpler.
-- Albert Einstein



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev