Bug 429552 - qt6-deprecated-api-fixes & qt6-qlatin1stringchar-to-u fail
Summary: qt6-deprecated-api-fixes & qt6-qlatin1stringchar-to-u fail
Status: RESOLVED FIXED
Alias: None
Product: clazy
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-23 14:11 UTC by Pino Toscano
Modified: 2020-11-23 17:26 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pino Toscano 2020-11-23 14:11:50 UTC
SUMMARY
When testing clazy 1.8 on current Debian unstable using LLVM 9, the qt6-deprecated-api-fixes & qt6-qlatin1stringchar-to-u tests fail when run on Linux architectures (at least on x86_64 and i386).

STEPS TO REPRODUCE
1. build clazy on a Linux architecture using LLVM 9
2. run the test suite, either from the build directory, or after installation

OBSERVED RESULT
Qt version: 51501
Qt headers: /usr/include/i386-linux-gnu/qt5
clang -Xclang -load -Xclang ClazyPlugin.so -Xclang -add-plugin -Xclang clazy  -Wno-unused-value -Qunused-arguments -std=c++14 -isystem /usr/include/i386-linux-gnu/qt5 -fPIC -L /usr/lib/i386-linux-gnu -c  -Xclang -plugin-arg-clazy -Xclang isempty-vs-count isempty-vs-count/main.cpp
Running: clang -Xclang -load -Xclang ClazyPlugin.so -Xclang -add-plugin -Xclang clazy  -Wno-unused-value -Qunused-arguments -std=c++14 -isystem /usr/include/i386-linux-gnu/qt5 -fPIC -L /usr/lib/i386-linux-gnu -c  -Xclang -plugin-arg-clazy -Xclang qt6-deprecated-api-fixes -Xclang -plugin-arg-clazy -Xclang export-fixes qt6-deprecated-api-fixes/main.cpp
output_file=qt6-deprecated-api-fixes/main.cpp.out
[FAIL] qt6-deprecated-api-fixes (plugin)
diff -Naur --strip-trailing-cr qt6-deprecated-api-fixes/main.cpp.expected qt6-deprecated-api-fixes/main.cpp.result
--- qt6-deprecated-api-fixes/main.cpp.expected  2020-11-22 14:30:50.000000000 +0000
+++ qt6-deprecated-api-fixes/main.cpp.result    2020-11-23 13:55:44.805401909 +0000
@@ -1,5 +1,5 @@
 qt6-deprecated-api-fixes/main.cpp:38:22: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
-qt6-deprecated-api-fixes/main.cpp:167:35: warning: non-void function does not return a value [-Wreturn-type]
+qt6-deprecated-api-fixes/main.cpp:167:35: warning: control reaches end of non-void function [-Wreturn-type]
 qt6-deprecated-api-fixes/main.cpp:29:9: warning:  function setPath() has to be used in Qt6 [-Wclazy-qt6-deprecated-api-fixes]
 qt6-deprecated-api-fixes/main.cpp:32:10: warning:  function setPath() has to be used in Qt6 [-Wclazy-qt6-deprecated-api-fixes]
 qt6-deprecated-api-fixes/main.cpp:35:10: warning:  function setPath() has to be used in Qt6 [-Wclazy-qt6-deprecated-api-fixes]


Qt version: 51501
Qt headers: /usr/include/i386-linux-gnu/qt5
clang -Xclang -load -Xclang ClazyPlugin.so -Xclang -add-plugin -Xclang clazy  -Wno-unused-value -Qunused-arguments -std=c++14 -isystem /usr/include/i386-linux-gnu/qt5 -fPIC -L /usr/lib/i386-linux-gnu -c  -Xclang -plugin-arg-clazy -Xclang qstring-allocations,foreach clazy/suppressionsWholeFile.cpp
Running: clang -Xclang -load -Xclang ClazyPlugin.so -Xclang -add-plugin -Xclang clazy  -Wno-unused-value -Qunused-arguments -std=c++14 -isystem /usr/include/i386-linux-gnu/qt5 -fPIC -L /usr/lib/i386-linux-gnu -c  -Xclang -plugin-arg-clazy -Xclang qt6-qlatin1stringchar-to-u -Xclang -plugin-arg-clazy -Xclang export-fixes qt6-qlatin1stringchar-to-u/main.cpp
output_file=qt6-qlatin1stringchar-to-u/main.cpp.out
[FAIL] qt6-qlatin1stringchar-to-u (plugin)
diff -Naur --strip-trailing-cr qt6-qlatin1stringchar-to-u/main.cpp.expected qt6-qlatin1stringchar-to-u/main.cpp.result
--- qt6-qlatin1stringchar-to-u/main.cpp.expected        2020-11-22 14:30:50.000000000 +0000
+++ qt6-qlatin1stringchar-to-u/main.cpp.result  2020-11-23 13:57:11.841399837 +0000
@@ -6,6 +6,8 @@
 qt6-qlatin1stringchar-to-u/main.cpp:27:20: warning: QLatin1Char or QLatin1String is being called [-Wclazy-qt6-qlatin1stringchar-to-u]
 qt6-qlatin1stringchar-to-u/main.cpp:30:24: warning: QLatin1Char or QLatin1String is being called [-Wclazy-qt6-qlatin1stringchar-to-u]
 qt6-qlatin1stringchar-to-u/main.cpp:30:42: warning: QLatin1Char or QLatin1String is being called [-Wclazy-qt6-qlatin1stringchar-to-u]
+qt6-qlatin1stringchar-to-u/main.cpp:30:24: warning: QLatin1Char or QLatin1String is being called [-Wclazy-qt6-qlatin1stringchar-to-u]
+qt6-qlatin1stringchar-to-u/main.cpp:30:42: warning: QLatin1Char or QLatin1String is being called [-Wclazy-qt6-qlatin1stringchar-to-u]
 qt6-qlatin1stringchar-to-u/main.cpp:31:16: warning: QLatin1Char or QLatin1String is being called [-Wclazy-qt6-qlatin1stringchar-to-u]
 qt6-qlatin1stringchar-to-u/main.cpp:34:16: warning: QLatin1Char or QLatin1String is being called [-Wclazy-qt6-qlatin1stringchar-to-u]
 qt6-qlatin1stringchar-to-u/main.cpp:36:27: warning: QLatin1Char or QLatin1String is being called [-Wclazy-qt6-qlatin1stringchar-to-u]

EXPECTED RESULT
qt6-deprecated-api-fixes & qt6-qlatin1stringchar-to-u pass on any architecture.

SOFTWARE/OS VERSIONS
Qt Version: 5.15.2
LLVM: 9
Comment 1 Pino Toscano 2020-11-23 14:31:36 UTC
Sorry, I typo'ed the Qt version, which is 5.15.1 (as also visible in the snippets).
Comment 2 Pino Toscano 2020-11-23 15:23:24 UTC
I just tried with LLVM 11, and these two tests pass.
Comment 3 Sergio Martins 2020-11-23 16:07:11 UTC
Git commit 04d38721ba951a9cafd276d584880d3f72c7794a by Sergio Martins.
Committed on 23/11/2020 at 16:05.
Pushed by smartins into branch '1.8'.

qt6-deprecated-api-fixes: Remove unrelated warnings from the test

There was a stray/unrelated compiler warning in the expected dataset.
Can make the test fail if some other compiler is used and gives a different
message

M  +1    -1    tests/qt6-deprecated-api-fixes/main.cpp
M  +0    -1    tests/qt6-deprecated-api-fixes/main.cpp.expected
M  +1    -1    tests/qt6-deprecated-api-fixes/main.cpp.fixed.expected

https://invent.kde.org/sdk/clazy/commit/04d38721ba951a9cafd276d584880d3f72c7794a
Comment 4 Sergio Martins 2020-11-23 16:32:04 UTC
Git commit c1dc65494574227646e1dd36675a5bd906660647 by Sergio Martins.
Committed on 23/11/2020 at 16:31.
Pushed by smartins into branch '1.8'.

qt6-qlatin1stringchar-to-u: Only run tests with clang 11

It's flaky with other versions.
Not disabling the check since it still works, just warns twice for
the same line.

CCMAIL: lucie.gerard@qt.io

M  +2    -1    tests/qt6-qlatin1stringchar-to-u/config.json

https://invent.kde.org/sdk/clazy/commit/c1dc65494574227646e1dd36675a5bd906660647
Comment 5 Pino Toscano 2020-11-23 17:26:27 UTC
Thanks for the quick fixes!

I can indeed confirm they work on both LLVM 9 and 11.

PS: the clazy 1.8 tar.gz does not have the content inside a top-level directory like clazy-1.8, unlike previous versions (and generally released Linux software).