Skip to content
This repository has been archived by the owner on Aug 6, 2023. It is now read-only.

False positive on operators within macros that turn them to strings #34

Open
kymckay opened this issue Jan 11, 2018 · 3 comments
Open
Labels

Comments

@kymckay
Copy link
Contributor

kymckay commented Jan 11, 2018

This is a pretty specific one, but came across it in the ace rangecard code:

missionNamespace getVariable format[QGVAR(%1_%2_%3_%4_%5), 1, 2, 3, 4, 5];

The macros turns it's contents into a string, but the linter interprets the % as a binary operator and errors. I'm personally unsure how best to approach fixing this, would just entirely disregarding the arguments supplied to a macro make sense?

@kymckay
Copy link
Contributor Author

kymckay commented Jul 30, 2018

If the preprocessor # operator is correctly added to the parser and evaluated within macro replacement, it would fix this issue for #define instances in the current file (as far as I can tell this will need to be done anyway in order to also implement the # sqf operator, see: #37).

If in future #include statements would check if the file exists and actually include it in the current file, this would then further fix it for #define instances in separate files.

@jonpas
Copy link
Contributor

jonpas commented Sep 17, 2019

Same for using macro arguments which have same name as commands, eg. GVAR(score).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants