https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81787
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu.org
--- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
struct T { int c; char d[]; };
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-fpermissive"
struct T t1 = { 1, "a" };
#pragma GCC diagnostic pop
struct T t = { 1, "a" };
This is not a bug and it was never meant to work. If it did, it was by chance
rather than by design.
warning: '-fpermissive' is not an option that controls warnings [-Wpragmas]
Similarly, one cannot use -Werror=permissive nor -Wno-error=permissive.
-fpermissive is an odd C++-only option and the warnings it generates cannot be
disabled.
My personal opinion is that we should instead have -Wpermissive, which defaults
to -Werror=permissive and works like any other -W* option should (and would
work with #pragma). -fpermissive can then become an alias for -Wpermissive,
like I did with -pedantic -> -Wpedantic.
Thus, either this is not a bug because -fpermissive is not an -W* option, or
-fpermissive should be reimplemented as -Wpermissive (with a default of
-Werror=permissive).