LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Local array initializations not recognized

Solved!
Go to solution

This code generates a compile warning:

 

myRoutine()

{

    unsigned int localBuffer[8] = {0,0,0,0,0,0,0,0};

 

    ...

 

    if (condition)

    {

        myVariable = localBuffer[1];

    }

}

 

==>   warning: variable 'localBuffer[1]' is possibly uninitialized when used here

0 Kudos
Message 1 of 3
(3,734 Views)
Solution
Accepted by topic author richferrara

Hello richferrara!

 

I would like to ask you if you could provide more detailed information about this compiler warning you're seeing, since I wasn't able to reproduce the issue in CVI 2012 or CVI 2013. Could you please provide the following details?

  1. An exact code snippet of the program that you're using.
  2. Provide the released version of CVI.
  3. Mention the Compiler Warning Level (located at Options » Build Options » Configuration Options » Compiler Warnings) you were using and possibly other specific compiler options you changed from their default values.

Thank you!

0 Kudos
Message 2 of 3
(3,723 Views)

Sorry, this was my goof.  I didn't realize the code I was editing had another array with the same name defined locally in another routine.

0 Kudos
Message 3 of 3
(3,714 Views)