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_precision warning suppression: loss of precision http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 #pragma W_PRECISION Warning suppression: Loss of precision
------------------------------------------------------------------------------
 Syntax
   #pragma W_PRECISION+|-

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

 Description
   The #pragma W_PRECISION directive controls the generation
   of a compiler warning when a value with a higher precision is assigned
   to a variable, or is received in an expression where only a lower
   precision can be accepted.

 Example
   #define EXAMPLE_DIRECTIV
   #include example.hdr

   proc Test_871
   vardef
      dbl  eNum1, eNum2
      uint uResult
   enddef
   eNum1 := 1.1
   eNum2 := 2.2
   
   // The functions max() and min() return dbl values, that are degraded
   // to uints in this example.
   
   #pragma W_PRECISION+
   uResult := max( eNum1, eNum2 )   // warning issued on loss of precision
   ? uResult
   
   #pragma W_PRECISION-
   uResult :=  min( eNum1, eNum2 )  // no warning for this line
   ? uResult
   endproc

   proc main
   Test_871()
   endproc

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