compuphase / pawn

Pawn is a quick and small scripting language that requires few resources.

Home Page:http://www.compuphase.com/pawn/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#warning directive

ziggi opened this issue · comments

Can you add something like #error but for creating user warnings? And something like #pragma warning for adding new warnings and disabling/enabling existing.

This implemented in fork of Pawn 3.2.3664 by Zeex: https://github.com/Zeex/pawn/wiki/What's-new#pragma-warning

#warning

Print a user warning.

This works similar to the #error directive. For example, compiling a file
that contains

#warning Don't include this file

would result in

warning 237: user warning: Don't include this file

#pragma warning

This directive comes in two forms:

  • #pragma warning (enable|disable) XXX

    Enable or disable a warning by its number.

    Useful for hiding unwanted warnings that otherwise cannot be fixed.

  • #pragma warning (push|pop)

    Save or restore the list of currently disabled warnings.

    This can be used in conjuction with the previous form to toggle warnings
    for a piece of code:

    #pragma warning push
    #pragma warning disable XXX
    // some code here
    ...
    #pragma warning pop

Implemented in commit 09070ba.