2017-07-04 2 views
0

travis-ciと組み合わせてPVS Studio(opensourceプロジェクトの無料版)を使用しています。何らかの理由で/usr/local/clang-3.5.0/lib/clang/3.5.0/includeV677を取り除く方法:標準タイプ警告のカスタム宣言

にあるファイルのエラーが発生します
 
/usr/local/clang-3.5.0/lib/clang/3.5.0/include/stddef.h:58:1: warning: V677 Custom declaration of a standard 'size_t' type. The declaration from system header files should be used instead. 
/usr/local/clang-3.5.0/lib/clang/3.5.0/include/stddef.h:86:1: warning: V677 Custom declaration of a standard 'wchar_t' type. The declaration from system header files should be used instead. 
/usr/local/clang-3.5.0/lib/clang/3.5.0/include/stdarg.h:30:1: warning: V677 Custom declaration of a standard 'va_list' type. The declaration from system header files should be used instead. 
/usr/local/clang-3.5.0/lib/clang/3.5.0/include/stddef.h:47:1: warning: V677 Custom declaration of a standard 'ptrdiff_t' type. The declaration from system header files should be used instead. 

この場所は非標準コンパイラの「システム」ヘッダーの例のようで、プロジェクトルート(AFAIRは/ home:標準のtravis場所のどこか)から離れています。スクリプト実行ではhttps://www.viva64.com/en/pvs-studio-download-linux/の最新バージョンが使用され、最新のバージョンは「Mon Jul 3 20:13:42 UTC 2017」で実行されます(残念ながら、使用されたバージョンは保存されません)。

+0

どうやら、これらのタイプが2回宣言されていると、コンパイラはこれらの場所の一つは、実際のライブラリであると考えています。おそらく、そのカスタムlibとclang std libとの間にある種のライブラリの競合があります。 – Lundin

+0

'/ usr/local/clang-3.5.0/bin/clang'や他のコンパイラでプロジェクトをコンパイルしていますか?この非システム 'clang'を使用していないなら、何らかの' CFLAGS'汚染を疑うでしょう。ビルドを実行するユーザの 'env'コマンドに' CFLAGS'が含まれていますか? – tgregory

+0

「取り除く方法...」 - 標準ヘッダを使用します。期待どおりに使用してください。 – Olaf

答えて

2

コンパイラが異常な場所に配置されている場合は、アナライザの例外への新しいパスを追加することをお勧めします。これにより、レポートには自分のプロジェクトのコードに関する警告のみが表示されます。

pvs-studio-analyzer analyze ... -e /path/to/exclude-path ...

または

pvs-studio ... --exclude-path /path/to/exclude-path ...

0

clangがclang-4.0に更新された場合、PVSはエラーを検出しないようです。

関連する問題