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

[PW3]: padding a macro argument shown twice #642

Open
jonpas opened this issue Feb 3, 2024 · 4 comments
Open

[PW3]: padding a macro argument shown twice #642

jonpas opened this issue Feb 3, 2024 · 4 comments
Labels
bug Something isn't working need info

Comments

@jonpas
Copy link
Collaborator

jonpas commented Feb 3, 2024

warning[PW3]: padding a macro argument
   ┌─ addons/shootingrange/functions/fnc_create.sqf:89:99
   │
89 │     ERROR_1("Invalid triggers in Trigger Markers! Make sure all triggers are correctly set! (%1)", _name);
   │                                                                                                   ^ padding a macro argument
   │
   = note: padding a macro argument is likely unintended
   = note: occured in: `ERROR_1`


warning[PW3]: padding a macro argument
   ┌─ addons/shootingrange/functions/fnc_create.sqf:89:99
   │
89 │     ERROR_1("Invalid triggers in Trigger Markers! Make sure all triggers are correctly set! (%1)", _name);
   │                                                                                                   ^ padding a macro argument
   │
   = note: padding a macro argument is likely unintended
   = note: occured in: `FORMAT_1`
@jonpas jonpas added the bug Something isn't working label Feb 3, 2024
@BrettMayson BrettMayson added the good first issue Good for newcomers label Feb 6, 2024
@BrettMayson
Copy link
Owner

Not able to create a MRE, will need to confirm this is still occuring on the next release.

This currently only produces a single error for me

#include "script_macros_common.hpp"

ERROR_1("Invalid triggers in Trigger Markers! Make sure all triggers are correctly set! (%1)", _name);

@BrettMayson BrettMayson added need info and removed good first issue Good for newcomers labels Feb 18, 2024
@jonpas
Copy link
Collaborator Author

jonpas commented Feb 18, 2024

I'll give it another test on latest.

@jonpas
Copy link
Collaborator Author

jonpas commented Feb 20, 2024

@Eathox
Copy link
Contributor

Eathox commented Jul 3, 2024

Also ran into this and took a quick look around, and frankly getting lost in the code base (wont be making a PR 😅).
However I did spot a bug in the tests which hides the warning, at:

let warning = config
.warnings()
.first()
.unwrap()
.diagnostic()
.unwrap()
.to_string(&WorkspaceFiles::new());

Changing that to something along the lines of:

let warning = config
    .warnings()
    .iter()
    .map(|w| w.diagnostic().unwrap().to_string(&WorkspaceFiles::new()))
    .collect::<String>();

Makes the example posted by Brett also spit out this warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need info
Projects
None yet
Development

No branches or pull requests

3 participants