LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

C switch implementation.

Does anyone know for certain how LabWindows/CVI implements large C switch statements. The switch index is an enumerated data type with 44 possible values. Other compilers that I am familiar with create an array of addresses to the case statements when there is a large well behaved index. To select the switch case, the program indexes the array and branches to the appropriate case code segment.
 
I would normally inspect an optional assembly listing created by the compiler for such questions, but I cannot find such a feature in LabWindows/CVI.
 
No guesses please. I need to know for certain.
 
Thanks
0 Kudos
Message 1 of 3
(3,120 Views)
Howdy crescent,

LabWindows/CVI is a 32-bit ANSI C compiler. The kernel of the LabWindows/CVI compiler is the lcc ANSI C compiler. Thus, however the lcc compiler implements the switch statement is how CVI will implement the switch statement.  You could probably google and learn about the lcc compiler to see what differences are implemented between other compilers.

Hope this helps!

Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 2 of 3
(3,073 Views)

Thanks,

I found material on the web including a book about compiler construction by the authors of lcc.

Charlie

 

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