c++ - Is `clang-check` failing to honor `-isystem`? -
for both clang , gcc, -isystem
flag adds "system" include path, causes compiler not emit warnings related code found in headers.
however, running clang-check
on code, see following warning:
in file included <myfile>.cpp:1: in file included <qt-path>/gcc_64/include/qtcore/qcoreapplication:1: in file included <qt-path>/gcc_64/include/qtcore/qcoreapplication.h:40: <qt-path>/gcc_64/include/qtcore/qobject.h:235:16: warning: potential memory leak return connectimpl(sender, reinterpret_cast<void **>(&signal), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated.
...so appear clang-check
not treat -isystem
include paths differently -i
include paths. misusing tool or misinterpreting output (i.e., potential error in code)? there way explicitly ignore errors qt headers when running clang-check
?
this because have include "qtcore" directory via-"isystem", in addition base qt include directory. because clang finds more specific include (qt -is modules well) , uses that. see clang manual -isystem information on how includes work.
effectively want following:
contains(qt,"core") { qmake_cxxflags *= $$join(qmake_incdir_qt, " -isystem", "-isystem", "/qtcore") }
and repeat standard qt modules (designer, gui, help, network, etc).
Comments
Post a Comment