Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ User's Guide - currently, the following options can be specified with pragmas: http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Currently, the following options can be specified with pragmas:

unreferenced
    The "unreferenced" option controls the way Watcom C/C++ handles unused
    symbols.  For example,


         #pragma on (unreferenced);

    will cause Watcom C/C++ to issue warning messages for all unused
    symbols.  This is the default.  Specifying


         #pragma off (unreferenced);

    will cause Watcom C/C++ to ignore unused symbols.  Note that if the
    warning level is not high enough, warning messages for unused symbols
    will not be issued even if "unreferenced" was specified.

check_stack
    The "check_stack" option controls the way stack overflows are to be
    handled.  For example,


         #pragma on (check_stack);

    will cause stack overflows to be detected and


         #pragma off (check_stack);

    will cause stack overflows to be ignored.  When "check_stack" is on,
    Watcom C/C++ will generate a run-time call to a stack-checking routine
    at the start of every routine compiled.  This run-time routine will
    issue an error if a stack overflow occurs when invoking the routine.
     The default is to check for stack overflows.  Stack overflow checking
    is particularly useful when functions are invoked recursively.  Note
    that if the stack overflows and stack checking has been suppressed,
    unpredictable results can occur.

    If a stack overflow does occur during execution and you are sure that
    your program is not in error (i.e.  it is not unnecessarily recursing),
    you must increase the stack size.  This is done by linking your
    application again and specifying the "STACK" option to the Watcom Linker
    with a larger stack size.

    It is also possible to specify more than one option in a pragma as
    illustrated by the following example.


         #pragma on (check_stack unreferenced);

reuse_duplicate_strings (C only)
    (C Only) The "reuse_duplicate_strings" option controls the way Watcom C
    handles identical strings in an expression.  For example,


         #pragma on (reuse_duplicate_strings);

    will cause Watcom C to reuse identical strings in an expression.  This
    is the default.  Specifying


         #pragma off (reuse_duplicate_strings);

    will cause Watcom C to generate additional copies of the identical
    string.  The following example shows where this may be of importance to
    the way the application behaves.

    Example:

         #include <stdio.h>

         #pragma off (reuse_duplicate_strings)


         void poke( char *, char * );

         void main()
           {
             poke( "Hello world\n", "Hello world\n" );
           }

         void poke( char *x, char *y )
           {
             x[3] = 'X';
             printf( x );
             y[4] = 'Y';
             printf( y );
           }
         /*
         Default output:
         HelXo world
         HelXY world
         */

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