Skip to content

Ignore -Winconsistent-dllimport warning from clang in wrap_init.cc

Kjell Ahlstedt requested to merge kjellahl/issue119 into master

Hopefully, this will fix issue #119 (closed).

It would be fine if someone could test this on Windows, with clang of course, but also with other compilers, such as MSVC.

@lb90 If you want to make changes directly in the generated files, glib/glibmm/wrap_init.cc and gio/giomm/wrap_init.cc, then replace

#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable : 4273 ) // Disable MSVC warning C4273 in wrap_init.cc momentarily
#endif // _MSC_VER

by

#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable : 4273 ) // Disable MSVC warning C4273 in wrap_init.cc momentarily
#elif defined(__GNUC__)
// gcc or clang, https://gitlab.gnome.org/GNOME/glibmm/-/issues/119
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Winconsistent-dllimport"
#endif

and

#ifdef _MSC_VER
#pragma warning( pop )
#endif // _MSC_VER

by

#ifdef _MSC_VER
#pragma warning( pop )
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

Merge request reports