How to suppress -Wreorder warning
-
I am writing a Qt5 desktop application including the openni library (Linux platform, 32 bit) . When I build the project I have a lot of warnings (-Wno-unknown-pragmas, -Wreorder) and I would like to suppress them.
Adding "QMAKE_CXXFLAGS_WARN_ON += -Wno-unknown-pragmas" in the .pro file, allows to suppress this kind of warning. But I am not able to suppress the -Wreorder.
Any suggestions? -
#pragma GCC diagnostic ignored "-Wformat"
Note that in general the use of pragmas is not recommended.
sources :
http://gcc.gnu.org/onlinedocs/gcc/Pragmas.html
https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas -
You can suppress all warning, and add only the warnings you want to :)
BTW I don't know why
@#pragma GCC diagnostic ignored “-Wformat”@didn't work, because the compiler "read" this line AFTER -Wall ...
Sorry to say that because it won't help you so much, but if I were you, I wouldn't suppress the Wreorder warning... Can't you just reorder ? I think it's more safe ! It's very hard to debug !