Skip to content

Fix #12699 QDir functions missing from qt.cfg#6374

Closed
chrchr-github wants to merge 2 commits intocppcheck-opensource:mainfrom
chrchr-github:chr_qdir
Closed

Fix #12699 QDir functions missing from qt.cfg#6374
chrchr-github wants to merge 2 commits intocppcheck-opensource:mainfrom
chrchr-github:chr_qdir

Conversation

@chrchr-github
Copy link
Copy Markdown
Collaborator

Co-authored-by: Dominik Strasser unknown@example.com

chrchr-github and others added 2 commits May 2, 2024 17:12
Co-authored-by: Dominik Strasser <unknown@example.com>
@firewave
Copy link
Copy Markdown
Collaborator

firewave commented May 2, 2024

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

Comment thread cfg/qt.cfg
<not-bool/>
</arg>
</function>
<!-- bool QDir::path() const -->
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this comment wrong it says that QDir::path returns bool?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest <use-retval/>

@dommldomml
Copy link
Copy Markdown

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".

@chrchr-github
Copy link
Copy Markdown
Collaborator Author

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?

@dommldomml
Copy link
Copy Markdown

dommldomml commented May 7, 2024

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

@chrchr-github
Copy link
Copy Markdown
Collaborator Author

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

@dommldomml
Copy link
Copy Markdown

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

@chrchr-github
Copy link
Copy Markdown
Collaborator Author

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

Please feel free to open your own PR.

@chrchr-github chrchr-github deleted the chr_qdir branch May 16, 2024 08:26
@chrchr-github chrchr-github restored the chr_qdir branch March 18, 2026 09:33
chrchr-github added a commit that referenced this pull request Mar 23, 2026
Continuation of #6374

---------

Co-authored-by: Dominik Strasser <unknown@example.com>
Co-authored-by: chrchr-github <noreply@github.com>
chrchr-github added a commit to chrchr-github/cppcheck that referenced this pull request Mar 31, 2026
Continuation of cppcheck-opensource#6374

---------

Co-authored-by: Dominik Strasser <unknown@example.com>
Co-authored-by: chrchr-github <noreply@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants