Ich versuche, ein Projekt zu erstellen, das die Bibliothek PAPI 5.4.3.0 in einem Arch Linux x86_64 verwendet.Pedantic Raising Fehler beim Binden von PAPI
Der Einfachheit halber reproduziert ich die Dinge, die ich in diesen beiden Dateien nicht verstehen:
A.cpp
#include "string.h"
#include "papi.h"
int main() {
}
B.cpp
#include "papi.h"
#include "string.h"
int main() {
}
Beim Kompilieren (zu einer Objektdatei) bekomme ich folgendes:
(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
Warum die -pedantic Flag Fehler wirft, aber keine Warnungen? (2)
Warum hat der 3. Lauf nicht nichts tut wirft (nur durch Umschalten der umfasst)?
Also die Flag * -pedantic-errors * sind nur um sicherzustellen, dass wenn es kein Fehler ist, die nur ein paar sind, wird es als eins behandelt? – yZaph
@yZaph, ja, richtig. – SergeyA