Q_GLOBAL_STATIC failed to expand macro, cppcheck
Unsolved
General and Desktop
-
wrote on 13 Feb 2025, 10:10 last edited by majorRonk
I'm using Qt 6.5.2 and cppcheck 2.7 on Ubuntu 22.04.5.
I compile and run code like this without any problem in QtCreator:
Q_GLOBAL_STATIC(const QString, ExampleContext, "ExampleInterface")
But i get a warning when i run cppcheck --qt=library ... (version 2.7)
"failed to expand Q_GLOBAL_STATIC
Wrong number of parameters for macro"I included header <QGlobalStatic> witch points to
#define Q_GLOBAL_STATIC(TYPE, NAME, ...) \ Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, (__VA_ARGS__))
I'dont know whats wrong here.
-
Hi,
Are you sure that this version of cppcheck has definitions that supports this macro ?
-
wrote on 19 Feb 2025, 09:21 last edited by
Could be. We are currently trying to fix it with cppcheck --project=compile_commands.json ... . Lets see if it works.
1/3