BrettMayson / HEMTT

Build System for Arma 3
http://hemtt.dev/
GNU General Public License v2.0
113 stars 40 forks source link

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

Closed jonpas closed 3 days ago

jonpas commented 9 months ago
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`
BrettMayson commented 8 months ago

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);
jonpas commented 8 months ago

I'll give it another test on latest.

jonpas commented 8 months ago

Still happens twice at https://github.com/Theseus-Aegis/Mods/blob/943906d18817a7f0829742f0c91cdad34456c594/addons/shootingrange/functions/fnc_create.sqf#L89 on 2fd248bd7b9cc36fe62a8b1d417a9bab4ad64215

You can see it in CI as well: https://github.com/BrettMayson/HEMTT/actions/runs/7953825250/job/21710390932#step:8:5080

Eathox commented 4 months ago

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: https://github.com/BrettMayson/HEMTT/blob/cf8d577295bfcba45092df9d2efbb3e08ca5a650/libs/preprocessor/tests/warnings.rs#L40-L46

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.