Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - #pragma extvar non-referenced extern inclusion control http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 #pragma EXTVAR      Non-referenced extern inclusion control
------------------------------------------------------------------------------
 Syntax
   #pragma EXTVAR+|-

 Arguments
   + and - control if the option is on or off, respectively.

 Description
   The #pragma EXTVAR directive controls the inclusion of external
   variable references in the object file.

   By default the compiler includes only those external variables in the
   object file that are referenced somewhere in the code. The default
   behavior can be overridden by the #pragma EXTVAR+ directive. In this
   case all declared external variable names appear in the object file,
   independly of their use in the code.

   The #pragma EXTVAR- directive can be used to override the effect of the
   -Ox compiler switch.

 Example
   #define EXAMPLE_DIRECTIV
   #include example.hdr

   /*
   The code below declares but does not use the external variable cName.
   The compiler by default does not refer to the unused symbol in the object
   file. By using #pragma EXTVAR+ the default behavior is overridden, and
   the reference to cName is placed in the object. This results in the linker
   issues a warning about the missing symbol - unless cName is indeed linked
   in from another module.
   */
   
   #pragma EXTVAR+
   
   vardef extern
      char cName
   enddef
   
   proc Test_860
   ? "Hello world"
   endproc

   proc main
   Test_860()
   endproc

See Also: -Ox

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson