I am including a file from a third-party library that raises an error that can be downgraded to a warning with -fpermissive
. But because I do not want to \"poll
It's maybe a bit late for this, but one of these ought to do what you wanted:
#pragma GCC diagnostic ignored "-fpermissive"
or
#pragma GCC diagnostic ignored "-pedantic"
"ignored" is how you squelch a diagnostic entirely, and the inverse of -fpermissive
is -pedantic
, for historical reasons.
tldr: You cannot turn off the fpermissive output after GCC 4.7.
Just posting this here so it has more visibility: unfortunately, zwol's answer (while well-intentioned, and potentially helpful to those with older GCC versions) does not work for more recent versions of GCC. From GCC 4.8 and beyond, you cannot turn off the fpermissive output. o11c in his comment to the OP helpfully provides the following bug which tracks this:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81787
Note that it is in the state "RESOLVED INVALID", so the inability to turn it off is the expected behavior and there are no plans to change it.