LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

auto storage class in C

Does anyone know why the native CVI compiler (the LCC compiler?) allows the auto storage class to be specified outside of a block (compound statement)?  The C89 spec sez you can't do this.  But it compiles and links OK in CVI, it looks like auto is ignored?  Does it come off the heap or the stack?  I.e., does it count against the stack size limit? 
 
Is there anywhere I can see just what goes onto the stack with the CVI compiler, exactly?  Local scope variables certainly, parameters (golden rule of parameterzation), registers, program counter, debug info, framing info, etc?  Can I just read up on the LCC compiler to answer these questions?
 
Thanks
 
Menchar
0 Kudos
Message 1 of 4
(3,221 Views)
Hey Menchar,

It looks like you may have found a bug in CVI.  I have notified R&D, and we are looking into the issue.  I will post any resolution that we find here.  Thanks for posting this!

Thanks,
Pat P.
Software Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,173 Views)

Looks like it might be, doesn't it.

I have found errors in the CVI native compiler in the past.   But then, it's essentially a freeware compiler, isn't it?   The LCC compiler?

I'd still like to know how to see memory allocation.  Is there a link map I can look at anywhere in CVI?

BTW the leading static syntax analyzer vendor (coverity) says he won't make his tool work with the native CVI compiler - too small of a market he says.

Menchar

0 Kudos
Message 3 of 4
(3,171 Views)
Hey Menchar,

I don't think we have a link map to look at, but I can tell you how things generally are stored into memory.  Locals, parameters/return values, return addresses, temporaries(used/generated by the compiler for intermediate results), their associated user-protection info, and uninit locals info if any all go onto the stack.  Everything else ends up on the heap.

Thanks,
Pat P.
Software Engineer
National Instruments
0 Kudos
Message 4 of 4
(3,127 Views)