loci: only ignore warnings supported by the compiler

GCC < 4.6 throws an error when we try to ignore unused-but-set-variable.
diff --git a/c_gen/c_code_gen.py b/c_gen/c_code_gen.py
index 7042312..09c4f2f 100644
--- a/c_gen/c_code_gen.py
+++ b/c_gen/c_code_gen.py
@@ -756,11 +756,19 @@
  *
  ****************************************************************/
 
-#if __GNUC__ >= 3
+#ifdef __GNUC__
+#include <features.h>
+
+#if __GNUC_PREREQ(4,4)
 #pragma GCC optimize ("s")
+#endif
+
+#if __GNUC_PREREQ(4,6)
 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
 #endif
 
+#endif
+
 #include <loci/loci.h>
 #include <loci/of_object.h>
 #include "loci_log.h"