Page 1 of 1

sub modul_sub() attribute(used) defined in module ? Problem

Posted: 05 January 2009, 9:10 AM
by ndudman
Hi

I'm confused :) Heres a small test case with my problem

I'm trying to define in a module a sub called module_sub(), using the attribute used as I need to call it from c code and its not otherwise used within zbasic. Anyway it seems to me only if I call this subroutine from Main() does it get included.

Thanks
Neil

Re: sub modul_sub() attribute(used) defined in module ? Prob

Posted: 05 January 2009, 9:27 AM
by dkinzer
ndudman wrote:only if I call this subroutine from Main() does it get included.
I don't know yet why that is happening. As a workaround, you can have all unused code included by adding this option to your project file:

Code: Select all

--optimize=no-unreferenced-code

Posted: 05 January 2009, 13:57 PM
by ndudman
Thanks for the work around

Neil

Posted: 06 January 2009, 11:53 AM
by dkinzer
The compiler version v2.6.9 contains a correction for this issue. You can download the full installer or just the compiler via the Downloads Page.

Posted: 09 January 2009, 7:13 AM
by ndudman
got it, thanks