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

Posted by Ferdinando M. Ametrano-3 on
URL: http://quantlib.414.s1.nabble.com/potentially-uninitialized-local-variables-in-Analytic-GJR-GARCH-1-1-Engine-tp12134p12136.html

On Fri, Nov 27, 2009 at 12:30 PM, Luigi Ballabio
<[hidden email]> wrote:

>> using potentially uninitialized local variables smells like a genuine bug to me
>
> Yes--in your compiler's branch detection algorithm :)
>
> 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.

Anyway I'm sure making the compiler happier would at least result in
more readable if-else code :-)

ciao -- Nando

------------------------------------------------------------------------------
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