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 w_extern warning suppression: extern initialization ignored http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 #pragma W_EXTERN    Warning suppression: Extern initialization ignored
------------------------------------------------------------------------------
 Syntax
   #pragma W_EXTERN+|-

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

 Description
   The #pragma W_EXTERN directive controls the generation
   of a compiler warning when assigning values to variables within an
   external declaration block.

 Example
   #define EXAMPLE_DIRECTIV
   #include example.hdr

   // In a multi-modular application it makes sense to declare public
   // variables in a common header file. These variables are external for
   // all modules, except the main module.
   
   #define MOD_MAIN       // this macro is only defined in the main module
   //#include common.hdr  // several modules contain this #include statement
   
   // The following variable declaration block would go to the header
   // named common.hdr. This header file is #included in several modules
   // of the application.
   
   #ifdef MOD_MAIN
      #pragma W_EXTERN+
      vardef public
   #else
      #pragma W_EXTERN-
      vardef extern
   #endif
   
         char    cFileCfg := "system.cfg"
         uint    uCustMax := 32000
         logical lEnd     := .f.
      enddef
   
   proc Test_865
   ? cFileCfg     // several modules can use the public variables
   ? uCustMax
   ? lEnd
   endproc

   proc main
   Test_865()
   endproc

See Also: extern

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