2
Arch Linux x86_64でPAPI 5.4.3.0ライブラリを使用するプロジェクトを作成しようとしています。 PAPIをリンクするときに脚立エラーが発生する
#include "papi.h"
#include "string.h"
int main() {
}
B.cpp
A.cpp
#include "string.h"
#include "papi.h"
int main() {
}
を
:簡単のために
は、私はこれらの2つのファイルに理解していないものを再現しました(オブジェクトファイルに)コンパイルすると、次のようになります。
(1)$ g++ A.cpp -c -std=c++11
(2)$ g++ A.cpp -c -std=c++11 -pedantic
In file included from b.cpp:2:0:
/usr/include/papi.h:1021:27: error: declaration of ‘int ffsll(long long int)’ has a different exception specifier
int ffsll(long long lli); //required for --with-ffsll and used in extras.c/papi.c
^
In file included from A.cpp:1:0:
/usr/include/string.h:524:26: error: from previous declaration ‘int ffsll(long long int) throw()’
__extension__ extern int ffsll (long long int __ll)
(3)$ g++ B.cpp -c -std=c++11 -pedantic
なぜ-pedanticフラグが警告をエラーを発生させますが、しないのですか?(2)
なぜ第三の実行が(ちょうど含んで切り替えることで)何を提起しませんでしょうか?
フラグ* -pedantic-errors *は、エラーではなく、ほんのわずかである場合には、1と扱われるようにすることです。 – yZaph
@yZaph、はい、正しい。 – SergeyA