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

Misc. fixes and improvements for unused assignment detection #679

Open Daniel-Cortez opened 2 years ago

Daniel-Cortez commented 2 years ago

What this PR does / why we need it:

This PR does the following:

Which issue(s) this PR fixes:

Fixes #669

What kind of pull this is:

Additional Documentation:

stale[bot] commented 2 years ago

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

Y-Less commented 2 years ago

It would be good if #pragma unused x could suppress this warning as well:

REMOTE_FUNC__ static void:yrt_7(&a, &b, c, &d)
{
    //print("yrt_7 called");
    a = 8;
    b = a;
    c += d;
    d -= 4;
    #pragma unused c
}

I get a warning on the c here (which is a correct warning), but the #pragma doesn't silence it. I'm actually testing that the value isn't propagated, so can't remove the assignment.

Daniel-Cortez commented 2 years ago

@Y-Less Thanks, I forgot to reset the "modified" flag when using #pragma unused/unread. This should be fixed now.