Some function pointers seem to confuse Cppcheck so that it thinks it was assigned directly to the integer.
voidf(){usingtfDllFunc0=int__stdcall(int*aCas,char*aStrIn,void*aPtr1,void*aPtr2,void*aPtr3,void*aPtr4,char*aStrOut);usingtfDllFunc1=int__stdcall(char*aStr);usingtfDllFunc2=int__stdcall(intaValue,char*aStr);tfDllFunc0*fDllFunc0=QLibrary::resolve("Test.dll","_func0@0");tfDllFunc1*fDllFunc1=QLibrary::resolve("Test.dll","_func1@0");tfDllFunc2*fDllFunc2=QLibrary::resolve("Test.dll","_func2@0");charvStr[256]={};intvInt=0;intrc=fDllFunc0(&vInt,nullptr,nullptr,nullptr,nullptr,nullptr,vStr);// AssignmentAddressToInteger(void)rc;rc=fDllFunc1(vStr);// AssignmentAddressToInteger(void)rc;rc=fDllFunc2(5,vStr);// no warning(void)rc;}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Some function pointers seem to confuse Cppcheck so that it thinks it was assigned directly to the integer.
Thanks! I can reproduce with cppcheck-2.0. With git head I get a segmentation fault.
I created ticket https://trac.cppcheck.net/ticket/9792