cppcheck icon indicating copy to clipboard operation
cppcheck copied to clipboard

Fix #12699 QDir functions missing from qt.cfg

Open chrchr-github opened this issue 1 year ago • 6 comments

Co-authored-by: Dominik Strasser [email protected]

chrchr-github avatar May 02 '24 15:05 chrchr-github

Having an unknown mail address is probably not good. So maybe we should not use that field.

firewave avatar May 02 '24 16:05 firewave

Yes, the comment is a copy-paste error. The failing regressions come from the fact that I fixed the function name of QDir::exists which used to be only "QDir".

dommldomml avatar May 07 '24 12:05 dommldomml

Yes, the comment is a copy-paste error. The failing regressions come from the fact that I fixed the function name of QDir::exists which used to be only "QDir".

Do you want to take this over?

chrchr-github avatar May 07 '24 15:05 chrchr-github

I can try. What I do not understand is the errors we are seeing. Maybe I have not yet understood the library config. We now have in qt.cfg:

false

This - according to my understanding - specifies the two functions from the comments as they are like one function with a default parameter.

The regression tests fail with: Checking /home/runner/work/cppcheck/cppcheck/test/cfg/qt.cpp ... /home/runner/work/cppcheck/cppcheck/test/cfg/qt.cpp:584:16: information: --check-library: There is no matching configuration for function QFile::exists() [checkLibraryFunction] if (QFile::exists("test")) {} ^ /home/runner/work/cppcheck/cppcheck/test/cfg/qt.cpp:622:12: information: --check-library: There is no matching configuration for function QFile::exists() [checkLibraryFunction] QFile::exists("test"); ^ /home/runner/work/cppcheck/cppcheck/test/cfg/qt.cpp:625:11: information: --check-library: There is no matching configuration for function QFile::exists() [checkLibraryFunction] file1.exists(); ^ /home/runner/work/cppcheck/cppcheck/test/cfg/qt.cpp:622:0: information: Unmatched suppression: ignoredReturnValue [unmatchedSuppression] QFile::exists("test"); ^ /home/runner/work/cppcheck/cppcheck/test/cfg/qt.cpp:625:0: information: Unmatched suppression: ignoredReturnValue [unmatchedSuppression] file1.exists(); ^

why are the function calls not regarded as matched ? And why is the use-retval ignored ? It is almost as if the whole entry is ignored whereas it seems to have worked before when the entry was bogus as it had instead of

Ah, now I see it. The regressions are about QFile::exists

dommldomml avatar May 07 '24 15:05 dommldomml

I think we now have only QDir::exists() instead of both QFile::exists() and QDir::exists().

chrchr-github avatar May 07 '24 15:05 chrchr-github

My bad. I misread it. I'll provide a new qt.cfg + qt.cpp

dommldomml avatar May 07 '24 15:05 dommldomml

My bad. I misread it. I'll provide a new qt.cfg + qt.cpp

Please feel free to open your own PR.

chrchr-github avatar May 16 '24 08:05 chrchr-github