GNOME Bugzilla – Bug 652272
glib 2.29.6 unconditionally use gcc-specific -Wstrict-aliasing
Last modified: 2011-09-05 00:10:55 UTC
Created attachment 189609 [details] Removal of -Wstrict-aliasing The unconditional use of -Wstrict-aliasing breaks compilation on non-gcc compilers (here: Sun Studio 12 on Solaris 9 sparc). The attached patch removes the flag, a shielding to gcc-only would also be ok.
It may fix the build, but it breaks the test... the entire point of the test was originally to verify that we don't get aliasing warnings. Does the sun studio compiler have a different flag to trigger aliasing warnings ?
There is a flag in Sun Studio "lint", but to my knowledge there is none in "cc". Probably it is then best to skip the whole test for non-gcc?
no, the test is actually checking that atomic ops do what they are supposed to do too, nowadays, so we probably just want to restrict the flag to be gcc-only
The issue is still present in 2.29.16. Should the setting be made around if test "x$GCC" = "xyes"; then ... in configure.ac? Best regards -- Dago
(In reply to comment #4) > The issue is still present in 2.29.16. Should the setting be made around > if test "x$GCC" = "xyes"; then > ... > in configure.ac? Yes. You could either do AM_CONDITIONAL(HAVE_GCC) or AC_SUBST(STRICT_ALIASING_CFLAGS)