Comment 43 for bug 992124

su_v (suv-lp) wrote :

The changes in r12112 to suppress compiler warnings use '-Wno-unused-but-set-variable' which is a relative new option only available in recent versions of GCC (introduced with FSF GCC 4.6). Older versions of GCC (apparently 4.2 and 4.3) don't ignore the unknown flag, but fail with an error [1]. The changes of r12112 break building for example on OS X with Apple's llvm-gcc-4.2 compiler:

  CC libgdl/libgdl_libgdl_a-gdl-i18n.o
  CC libgdl/libgdl_libgdl_a-gdl-dock-object.o
  CC libgdl/libgdl_libgdl_a-gdl-dock-master.o
  CC libgdl/libgdl_libgdl_a-gdl-dock.o
cc1: error: unrecognized command line option "-Wno-unused-but-set-variable"
cc1: error: unrecognized command line option "-Wno-unused-but-set-variable"
cc1: error: unrecognized command line option "-Wno-unused-but-set-variable"
cc1: error: unrecognized command line option "-Wno-unused-but-set-variable"
make[3]: *** [libgdl/libgdl_libgdl_a-gdl-dock.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [libgdl/libgdl_libgdl_a-gdl-dock-master.o] Error 1
make[3]: *** [libgdl/libgdl_libgdl_a-gdl-i18n.o] Error 1
make[3]: *** [libgdl/libgdl_libgdl_a-gdl-dock-object.o] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Could this flag be added conditionally, rather than be the reason to completely remove support for older GCC versions altogether at this point?

-----
[1] see e.g. <http://article.gmane.org/gmane.network.freerdp.devel/1354>