[clazy] [Bug 398633] New: Feature request add tests for qt containers and qobjects
Mike Harris
bugzilla_noreply at kde.org
Fri Sep 14 19:32:43 BST 2018
https://bugs.kde.org/show_bug.cgi?id=398633
Bug ID: 398633
Summary: Feature request add tests for qt containers and
qobjects
Product: clazy
Version: unspecified
Platform: Other
OS: Linux
Status: UNCONFIRMED
Severity: normal
Priority: NOR
Component: general
Assignee: unassigned-bugs at kde.org
Reporter: mike.a.harris at outlook.com
CC: smartins at kde.org
Target Milestone: ---
I have a very simple example that refuses to be flagged by either clang,
clang-tidy, clazy, or Krazy2.
QVector<int> myVec;
myVec.push_back(1);
myVec.push_back(2);
int third = myVec.at(3);
int otherThird =myVec[3];
obviously this segfaults because there was never a third element.
The issue is that no single IDE or plugin will flag this. It'll ASSERT in Qt
Creator debug build run but that's after it compiles.
there has to be some intellisense like thing in the editor or any static
analysis tool that can read Qt Containers.
"Just add the Qt source to your code model" you might say well compiling every
single part of Qt takes many days so not an option.
Another example is
QCheckBox *myCheckbox = new QCheckBox();
QListView *myListView = qobject_cast<QListView *>(myCheckBox); //will equal
null
QSize size = myListView->gridSize(); //myListView is null so crashes with
segfault again
This leads to deep bugs that aren't flagged with any static analysis tool.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Unassigned-bugs
mailing list