나는 cmake를 통해 연타-깔끔한 사용하는 빌드를 가지고 :음소거 그 소리-깔끔한
set_target_properties(project
PROPERTIES
...
CXX_CLANG_TIDY
"/usr/bin/clang-tidy"
"-checks=modernize-*,readability-*,performance-*"
"-fix"
)
내가 Qt는 라이브러리 내부 가능한 메모리 누수 무엇입니까를 구축하는 동안 :
/opt/Qt5.7.0/5.7/gcc_64/include/QtCore/qobject.h:242:16: warning: Potential memory leak [clang-analyzer-cplusplus.NewDeleteLeaks]
return connectImpl(sender, reinterpret_cast<void **>(&signal),
^
.../a.cpp:27:5: note: Taking false branch
if (not inputQFile.makeAbsolute()) {
^
.../a.cpp:33:5: note: Calling 'QObject::connect'
connect(this, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
^
/opt/Qt5.7.0/5.7/gcc_64/include/QtCore/qobject.h:238:13: note: Left side of '||' is false
if (type == Qt::QueuedConnection || type == Qt::BlockingQueuedConnection)
^
/opt/Qt5.7.0/5.7/gcc_64/include/QtCore/qobject.h:238:9: note: Taking false branch
if (type == Qt::QueuedConnection || type == Qt::BlockingQueuedConnection)
^
/opt/Qt5.7.0/5.7/gcc_64/include/QtCore/qobject.h:242:16: note: Potential memory leak
return connectImpl(sender, reinterpret_cast<void **>(&signal),
^
어떻게을 나는 이것을 침묵 하는가?
난 이미 시도 무엇 :
- 는 a.cpp의 끝에
// NOLINT
를 추가> 효과 없음 - : - 242 33> 효과 - 이 qobject.h의 끝에
// NOLINT
를 추가하지 - 랩 qobject.h :에 242
#ifndef __clang_analyzer__
->에는 효과 없음 - 랩 qobject.h의 모든
#ifndef __clang_analyzer__
-> 효과 - 가 접속 .. 모든 라인에
// NOLINT
를 추가하지 MPL -> @Tarod
그 소리-깔끔한 충돌 :
#ifndef __clang_analyzer__
return connectImpl(sender, reinterpret_cast<void **>(&signal),
receiver, reinterpret_cast<void **>(&slot),
new QtPrivate::QSlotObject<Func2, typename QtPrivate::List_Left<typename SignalType::Arguments, SlotType::ArgumentCount>::Value, // NOLINT
typename SignalType::ReturnType>(slot),
type, types, &SignalType::Object::staticMetaObject); // NOLINT
#endif //__clang_analyzer__
'#ifndef __clang_analyzer__ '가 작동해야합니다. 'qobject.h' 파일의 끝에'# endif '를 넣고 있습니까? – Tarod
@Tarod 질문을 업데이트했습니다. – Mac
'qobject.h' 파일의 시작 부분에'#ifndef __clang_analyzer__'을 넣으면 같은 문제가 발생합니까? – Tarod