LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI2015 warning unitialized variable

In CVI2015, when I write

 

for(int i=0; i<max; i++) { }

 

and so I declare the variable i while initializing it, I get the following compiler warning

 

variable 'i' may be uninitialized when used here

 

I don't think the warning has a reason; and in CVI 2012 the warning is not shown.

 

Is this a bug?

 

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 1 of 3
(4,296 Views)

Hello vix!

 

Unfortunately I'm not able reproduce the incorrect error that you reported.

I suspect that the for-loop is part of a larger context, which could give us a clue why you are getting that warning.

 

Can you send us the code of the entire function that you used?

 

Regards,

- Johannes

0 Kudos
Message 2 of 3
(4,245 Views)

Hello Johannes,

I think you're right.

In my code the for() loop is inside a switch{} and I need to deeper investigate and try to create a small example which reproduces the problem.

 

I let you know

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 3 of 3
(4,222 Views)