Summary: | inefficient-qlist & inefficient-qlist-soft fail on 32bit Linux architectures | ||
---|---|---|---|
Product: | [Developer tools] clazy | Reporter: | Pino Toscano <pino> |
Component: | general | Assignee: | Sergio Martins <smartins> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | eric.lemanissier, smartins |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Debian unstable | ||
OS: | Linux | ||
See Also: | https://bugs.kde.org/show_bug.cgi?id=423728 | ||
Latest Commit: | https://commits.kde.org/clazy/ad8e58e41537a9656b7924b5447fdb6e7bbad43e | Version Fixed In: | |
Sentry Crash Report: |
Description
Pino Toscano
2018-11-28 07:12:59 UTC
Git commit 9713a15f65424f06e45c78fc1bf1c2d2b27f4e36 by Sergio Martins. Committed on 01/12/2018 at 15:52. Pushed by smartins into branch '1.4'. inefficient-qlist: Use 64 as the limit, instead of sizeof(void*) Means that if you're programming in a 32-bit environment you should write portable code and not pessimize for 64-bit platforms. If your code will never run in 64-bit using QVector won't be a pessimization anyway, it's a good default. Also fixes the unit-test output being different in 32-bit. M +1 -1 docs/checks/README-inefficient-qlist-soft.md M +4 -1 docs/checks/README-inefficient-qlist.md M +3 -1 src/QtUtils.h M +3 -2 src/checks/inefficientqlistbase.cpp https://commits.kde.org/clazy/9713a15f65424f06e45c78fc1bf1c2d2b27f4e36 This commit silences a totally valid warning on 32 bit platforms: QLists of objects between 32bits and 64bits. They truely are inefficient, so it is a pessimization, and they should be replaced by QVector. What is more, replacing these QList by QVector is not a pessimization on 64 bits, so I don't get your argument about portability. I think the proper fix would be to change SmallType in the test code with struct SmallType { char a[sizeof(void*)]; }; you're right, reading the commit again it doesn't make much sense now :) Git commit ad8e58e41537a9656b7924b5447fdb6e7bbad43e by Sergio Martins. Committed on 03/12/2018 at 18:59. Pushed by smartins into branch '1.4'. inefficient-qlist: Fix unit-tests on 32-bit. M +1 -1 tests/inefficient-qlist-soft/main.cpp M +1 -1 tests/inefficient-qlist/main.cpp https://commits.kde.org/clazy/ad8e58e41537a9656b7924b5447fdb6e7bbad43e |