pawn-lang / compiler

Pawn compiler for SA-MP with bug fixes and new features - runs on Windows, Linux, macOS
Other
301 stars 71 forks source link

Pawndoc and deprecation messages collide #705

Open Y-Less opened 2 years ago

Y-Less commented 2 years ago
#pragma option -r

/**
 * - documentation
 */
#pragma deprecated - message
Func() {}

main()
{
    Func();
}

Output:

warning 234: function is deprecated (symbol "Func") - message
#pragma option -r

main()
{
    Func();
}

/**
 * - documentation
 */
#pragma deprecated - message
Func() {}

Output:

warning 234: function is deprecated (symbol "Func") - documentation 

They both use the ->documentation field in the symbol struct, and clearly order matters.

Y-Less commented 2 years ago

Furthermore:

//#pragma option -r

main()
{
    Func();
}

/**
 * - documentation
 */
#pragma deprecated - message
Func() {}

Output:

warning 234: function is deprecated (symbol "Func") 

Disabling pawndoc means neither get used.