I am using the nlohmann json (https://github.com/nlohmann/json) library (1 single json.h file) with Qt. I realize Qt has it's own json functionality, so assume that any third party header may be used. Qt generates a whole lot of issues/warnings and I would like to try suppress issues/warnings for just the json.h file.
[EDIT] Interestingly the json third party library has been updated from v3.3.0 to v3.4.0 and all warnings gone (probably best outcome). Nonetheless, being able to suppress third party warnings would still be great.
I tried the suggestions here, by putting the .h in a sub directory as well as adding the sub directory to the INCLUDEPATH. $$PWD will apparently give the current directory of the .pro file. But there is no change after doing this.
INCLUDEPATH += $$PWD/thirdparty
QMAKE_CXXFLAGS += -isystem $$PWD/thirdparty/
The warnings are easy to reproduce by the simple hello world example below:
#include <QCoreApplication>
#include <QDebug>
#include "json.h"
using namespace nlohmann;
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
qDebug() << "hello world";
return a.exec();
}
[EDIT] Still hoping for some help. From the comments I have tried wrapping the inclusion, which didn't work, with what is seen below:
#pragma warning(push, 0)
#include "json.h"
#pragma warning(pop)
I am using qmake but thought that maybe gcc solutions might apply, seems they don't.
Any help would be greatly appreciated.