This is a Minimal, Complete, and Verifiable example:
#include <QTimer>
#include <QApplication>
#include <QtDebug>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QObject boo;
QTimer::singleShot(0, &boo, []() {
qDebug() << "hi";
});
}
This is my CMakeLists.txt:
cmake_minimum_required(VERSION 3.10)
find_package(Qt5Widgets REQUIRED)
include_directories(${Qt5Widgets_INCLUDE_DIRS})
add_executable(boo main.cpp)
qt5_use_modules(boo Widgets)
If I run clang-analyzer against it:
$ mkdir build && cd build && scan-build cmake .. && scan-build cmake --build .
...
warning: Path diagnostic report is not generated. Current output format does not support diagnostics that cross file boundaries. Refer to --analyzer-output for valid output formats
In file included from /tmp/boo/main.cpp:1:
In file included from /usr/include/qt/QtCore/QTimer:1:
/usr/include/qt/QtCore/qtimer.h:154:5: warning: Potential memory leak
}
^
What I can not understand is this:
warning: Path diagnostic report is not generated. Current output format does not support diagnostics that cross file boundaries. Refer to --analyzer-output for valid output formats
But scan-build
have no --analyzer-output
, how can I include qtimer.h
problem
into report?