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_paramsize warning suppression: parameter size mismatch http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 #pragma W_PARAMSIZE Warning suppression: Parameter size mismatch
------------------------------------------------------------------------------
 Syntax
   #pragma W_PARAMSIZE+|-

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

 Description
   The #pragma W_PARAMSIZE directive controls the generation
   of a compiler warning when a char variable is passed by reference to a
   function that expects a character with greater width.

 Example
   #define EXAMPLE_DIRECTIV
   #include example.hdr

   #pragma W_PARAMSIZE+ // turn on parameter size warning
   
   proc Test static
   param char cString
   //param char( 10 ) cString // this prevents the problem
   
   // Caution: uncommenting the line below overwrites memory, and causes
   // system crash.
   
   // cString := "" // 256 zero bytes are written at the address of the string
   endproc
   
   proc Test_1446
   vardef
      char( 10 ) cName // only 11 bytes are allocated for this string
   enddef
   cName := "Hello"
   Test( cName )       // warning is issued
   ? cName
   endproc

   proc main
   Test_1446()
   endproc

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