Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-l flag only outputs the first compiler pass #116

Open
ziggi opened this issue Sep 11, 2016 · 2 comments
Open

-l flag only outputs the first compiler pass #116

ziggi opened this issue Sep 11, 2016 · 2 comments

Comments

@ziggi
Copy link
Contributor

ziggi commented Sep 11, 2016

Default ALS method:

native printf(const format[], {Float,_}:...);
forward OnGameModeInit();

main() {}

// ---------------------------------------------------------------------
public OnGameModeInit()
{
    printf("OnGameModeInit 1");
    #if defined Prefix_OnGameModeInit
        return Prefix_OnGameModeInit();
    #else
        return 1;
    #endif
}
#if defined _ALS_OnGameModeInit
    #undef OnGameModeInit
#else
    #define _ALS_OnGameModeInit
#endif

#define OnGameModeInit Prefix_OnGameModeInit
#if defined Prefix_OnGameModeInit
    forward Prefix_OnGameModeInit();
#endif

// ---------------------------------------------------------------------
public OnGameModeInit()
{
    printf("OnGameModeInit 2");
    #if defined Prefix2_OnGameModeInit
        return Prefix2_OnGameModeInit();
    #else
        return 1;
    #endif
}
#if defined _ALS_OnGameModeInit
    #undef OnGameModeInit
#else
    #define _ALS_OnGameModeInit
#endif

#define OnGameModeInit Prefix2_OnGameModeInit
#if defined Prefix2_OnGameModeInit
    forward Prefix2_OnGameModeInit();
#endif

// ---------------------------------------------------------------------
public OnGameModeInit()
{
    printf("OnGameModeInit");
    return 1;
}

Results:

OnGameModeInit 1
OnGameModeInit 2
OnGameModeInit

It's ok, but if I compile it with -l param, I got this:

#pragma ctrlchar 0x5c
#pragma pack false
#pragma semicolon true
#pragma tabsize 8
#file "sources\default.pwn"
#line 1

native printf(const format[], {Float,_}:...);

main() {}

forward OnGameModeInit();

public OnGameModeInit()
{
    printf("OnGameModeInit 1");
#line 14
        return 1;
#line 16
}
#line 22

#line 27






public Prefix_OnGameModeInit()
{
    printf("OnGameModeInit 2");
#line 39
        return 1;
#line 41
}
#line 47

#line 52


public Prefix2_OnGameModeInit()
{
    printf("OnGameModeInit");
    return 1;
}

And this is wrong.

@oscar-broman
Copy link
Contributor

Yeah -l should do the second compiler pass which resolves #if defined among other things.

@Southclaws Southclaws changed the title -l bug -l flag only outputs the first compiler pass Jan 4, 2018
@stale
Copy link

stale bot commented Oct 26, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the state: stale label Oct 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants