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

Discussion of issues related specifically to writing code for native mode devices. This includes ZBasic code as well as assembly language code and C code, both inline and standalone.
Post Reply
ndudman
Posts: 79
Joined: 25 December 2008, 14:00 PM

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

Post 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
Attachments
test.zip
(7.79 KiB) Downloaded 2610 times
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

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

Post 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
- Don Kinzer
ndudman
Posts: 79
Joined: 25 December 2008, 14:00 PM

Post by ndudman »

Thanks for the work around

Neil
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post 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.
- Don Kinzer
ndudman
Posts: 79
Joined: 25 December 2008, 14:00 PM

Post by ndudman »

got it, thanks
Post Reply