In Qt code, any (if not all) lines using the Q_EMIT macro:
Q_EMIT mySignal(42);
now trigger a shadowFunction warning like:
shadowFunction
warning: Local variable 'mySignal' shadows outer function [shadowFunction] Q_EMIT mySignal(42);
I see a specific line to define the emit macro in qt.cfg (which I'm using) but nothing about Q_EMIT. I've been able to fix the issue locally by using a custom config file with the following content:
emit
Q_EMIT
<?xml version="1.0" encoding="UTF-8"?> <def format="2"> <define name="Q_EMIT" value=""/> </def>
This should probably be added to the qt.cfg
How do you load the library? Which command-line do you use?
Could you also provide a full code sample which triggers the warning?
Thanks.
See https://github.com/danmar/cppcheck/pull/4786
Log in to post a comment.
In Qt code, any (if not all) lines using the Q_EMIT macro:
now trigger a
shadowFunction
warning like:I see a specific line to define the
emit
macro in qt.cfg (which I'm using) but nothing aboutQ_EMIT
. I've been able to fix the issue locally by using a custom config file with the following content:This should probably be added to the qt.cfg
How do you load the library? Which command-line do you use?
Could you also provide a full code sample which triggers the warning?
Thanks.
See https://github.com/danmar/cppcheck/pull/4786