[Insight-developers] Borland and Warnings about unused variables
Luis Ibanez
luis.ibanez at kitware.com
Wed Jul 9 11:47:13 EDT 2008
Bill,
You are right. Thanks for the clarification.
I thought Borland was being dumb,
but it turns out that it is being too smart...
I'll remove the initializations then.
Thanks
Luis
--------------------
Bill Lorensen wrote:
> I think that warning is correct. numiter is assigned a value later in
> the code. If you follow each if/else block, you'll see that numiter is
> always assigned a value.
>
> Bill
>
> On Wed, Jul 9, 2008 at 10:22 AM, Luis Ibanez <luis.ibanez at kitware.com> wrote:
>
>>Bill,
>>
>>The Borland compiler is producing warnings about unused variables
>>in cases where they don't seem to be appropriate.
>>
>>For example:
>>
>>http://www.cdash.org/CDash/viewBuildError.php?type=1&buildid=118772
>>
>>corresponding to:
>>
>>Code/Review/itkExponentialDeformationFieldImageFilter.txx Line: 83
>>
>>where the variable "numiter" is initialized to zero, and then it is
>>used in line 139:
>>
>> ProgressReporter progress(this, 0, numiter+1, numiter+1);
>>
>>and line 141:
>>
>> if( numiter == 0 )
>> {
>>
>>
>>----
>>
>>The warning seems to be bogus...
>>
>>Is there a known way to get around this warning without having
>>to degrade the code.
>>
>>
>> Thanks for any suggestions,
>>
>>
>> Luis
>>
>>
>>
>
>
More information about the Insight-developers
mailing list