Section External - stop functions from being optimised out?

Xavier Oswald x.oswald at free.fr
Thu Nov 13 18:52:38 UTC 2008


On 08:48 Tue 11 Nov     , Jeremy Cowgar wrote:
> Greetings!
> 
> How can I stop the compiler from optimising an external function out of
> existance? Here is an example:
> 
> Section External
> 
>   - say_hello ih:POINTER :INTEGER <-
>   (
>     "Hello, World!\n".print;
>     `IUP_CLOSE`:INTEGER
>   );
> 
> Section Public
> 
>   - main <-
>   (
>     // code
>     `IupSetCallback(@control, "ACTION", say_hello)`;
>     // code
>   );
> 
> The external function "say_hello" is never used directly, thus the compiler
> is removing it from the compiled code. How can I tell the compiler to
> keep say_hello?

You can do this whithout using your tips.

Have a look in the manual about external usage, there is a comment about lisaac
removing function. If I well remember, you could use a return parameter between
parenthesis and thus, the code will not be removed.

Greetings,
-- 
  ,''`.  Xavier Oswald <x.oswald at free.fr>                   
 : :' :  GNU/LINUX Debian Maintainer                        
 `. `'   GnuPG Key ID 0x88BBB51E                            
   `-    938D D715 6915 8860 9679  4A0C A430 C6AA 88BB B51E 




More information about the Lisaac-devel mailing list