Skip to content

Improve qt.cfg: unreadVariable for macro parameter#4683

Merged
danmar merged 15 commits intocppcheck-opensource:mainfrom
chrchr-github:chr_QtVerify
Jan 7, 2023
Merged

Improve qt.cfg: unreadVariable for macro parameter#4683
danmar merged 15 commits intocppcheck-opensource:mainfrom
chrchr-github:chr_QtVerify

Conversation

@chrchr-github
Copy link
Copy Markdown
Collaborator

Not sure why #include <QTest> is not found.

@firewave
Copy link
Copy Markdown
Collaborator

firewave commented Jan 5, 2023

/home/runner/work/cppcheck/cppcheck/test/cfg/qt.cpp:22:10: fatal error: QtTest: No such file or directory

It is called QTest - mind the extranous t.

@chrchr-github
Copy link
Copy Markdown
Collaborator Author

/home/runner/work/cppcheck/cppcheck/test/cfg/qt.cpp:22:10: fatal error: QtTest: No such file or directory

It is called QTest - mind the extranous t.

Well, that's what I tried first, with the same result. I suspect that a Qt module is missing somehow.

@firewave
Copy link
Copy Markdown
Collaborator

firewave commented Jan 5, 2023

In test/cfg/runtests.sh you have to add Qt5Test to the two pkg-config calls in function qt_fn.

@firewave
Copy link
Copy Markdown
Collaborator

firewave commented Jan 5, 2023

In test/cfg/runtests.sh you have to add Qt5Test to the two pkg-config calls in function qt_fn.

Oh, I see that you already did that. Lemme try that locally.

@chrchr-github
Copy link
Copy Markdown
Collaborator Author

Like so? (Commit was reverted, then un-reverted)

@chrchr-github
Copy link
Copy Markdown
Collaborator Author

In test/cfg/runtests.sh you have to add Qt5Test to the two pkg-config calls in function qt_fn.

Oh, I see that you already did that. Lemme try that locally.

Thanks, I don't have access to a similar system right now.

@firewave
Copy link
Copy Markdown
Collaborator

firewave commented Jan 5, 2023

Found the actual issue. function get_pkg_config_cflags only passes the first parameter along. You need to change $1 tp $* for it to pass all parameters to the underlying call.

@chrchr-github
Copy link
Copy Markdown
Collaborator Author

Awesome, that did it...

@firewave
Copy link
Copy Markdown
Collaborator

firewave commented Jan 5, 2023

If you add quotes you need to use "$@" instead of "$*" so the parameters stay individual ones - that also what shellcheck suggested:

In ./test/cfg/runtests.sh line 36:
    PKGCONFIG=$(pkg-config --cflags $*)
                                    ^-- SC2048: Use "$@" (with quotes) to prevent whitespace problems.

@chrchr-github
Copy link
Copy Markdown
Collaborator Author

Fixed, but seemed to work nonetheless.

@danmar danmar merged commit b29f111 into cppcheck-opensource:main Jan 7, 2023
@chrchr-github chrchr-github deleted the chr_QtVerify branch February 1, 2023 14:36
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.

3 participants