pawn-lang / compiler

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

Compiler crash, wrong public function params? #664

Closed Vince0789 closed 2 years ago

Vince0789 commented 3 years ago

Issue description:

Not sure how to describe this really, but at @Y-Less request I'm opening an issue here. Basically if you have the callbacks (see below) used in Pawn.CMD and you then include y_commands the compiler crashes.

Minimal complete verifiable example (MCVE):

How to reproduce:

#include <a_samp>
#include <YSI_Visual\y_commands>

public OnPlayerCommandReceived(playerid, cmd[], params[], flags)
{
    return 1;
}

public OnPlayerCommandPerformed(playerid, cmd[], params[], result, flags)
{
    return 1;
}

Workspace Information:

killermvc commented 3 years ago

After tinkering a bit with the code provided by Vince i was able to reduce it to this

forward OnCallback(arr[]);
public OnCallback(array[]) {}

This seems to happen when the name of an array in the forward declaration isn't the same as in the public. When telling sampctl to compile with compiler version 3.10.9 the compiler outputs the expected (error) function heading differs from prototype for both Vince's MCVE and mine. The compiler also crashes when compiling with -l.

This was also reported in #637.

Daniel-Cortez commented 3 years ago

A duplicate of #600, #637. Already fixed in #561.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity.