Skip to content
Zeex edited this page Feb 1, 2014 · 14 revisions

Table of contents

Bug fixes

See Known compiler bugs for the full list of known bugs and their current status.

Features

Preprocessor directives

#pragma naked

Suppress the "must return a value" warning for a function.

This can be used on functions that don't have a return statement but still return a value, e.g. via #emit retn.

#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 warnigns 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

#warning

Print a custom warning.

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

#pragma warning Don't include this file

would result in

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

Built-in constants

__line

Holds the current line number.

Other features

Trailing comma in array initialiers

It is now allowed to have a final trailing comma in array initializer lists:

new a[][] = {
    {1, 2},
    {3, 4}, // no error
};

Breaking changes

The following change may break existing code:

  • Disabled generation of the _inc_XXX symbols for included files (they were buggy and behaved differently on differnt platforms)

  • Redefined __Pawn as 0x030A (previously was 0x0302). This can be used to detect this compiler at compile-time

Other changes

  • Appended .samp to the version string to distinguish this compiler from the official one
Clone this wiki locally