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_indirect warning suppression: indirect reference to function name http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 #pragma W_INDIRECT  Warning suppression: Indirect reference to function name
------------------------------------------------------------------------------
 Syntax
   #pragma W_INDIRECT+|-

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

 Description
   The #pragma W_INDIRECT directive controls the generation
   of a compiler warning when a function name is used in an expression
   without the ending parentheses. In this case the expression will receive
   the function's address instead of its return value. There are situations,
   where it is required to pass the function's address (like in the
   on key do command), in which case the respective warning can be
   suppressed by using the #pragma W_INDIRECT- directive.

 Example
   #define EXAMPLE_DIRECTIV
   #include example.hdr

   func uint KeyFunc1 static
   return( __last_key )
   endfunc
   
   func uint KeyFunc2 static
   return( __last_key )
   endfunc
   
   proc Test_868
   #pragma W_INDIRECT+
   on key do KeyFunc1      // warning is issued for this line
   #pragma W_INDIRECT-
   on error do KeyFunc2    // no warning for this line
   endproc

   proc main
   Test_868()
   endproc

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