@ , ...
-Werror #pragma GCC diagnostics warning "-W<kind>". :
#pragma GCC diagnostic push
# pragma GCC diagnostic warning "-Wreturn-type"
# pragma GCC diagnostic warning "-Wmissing-braces"
# include "legacy-crap.h"
#pragma GCC diagnostic pop
gcc /:
warning-test.c:11:1: warning: return type defaults to ‘int’ [-Wreturn-type]
warning-test.c:11:1: error: return type defaults to ‘int’ [-Wreturn-type]
This can be used to accurately select the exact diagnosis, which should be considered a warning instead of an error during processing by a third party that you cannot change. I don’t know a short hand to turn off all warnings ( "-Wall"it will not have the desired effect for the above #pragma), but I think it’s also good to be explicit here.
source
share