]> granicus.if.org Git - gc/commitdiff
Suppress false 'unused argument' warnings for GCC v3
authorIvan Maidanski <ivmai@mail.ru>
Mon, 27 Feb 2012 04:37:12 +0000 (08:37 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 27 Feb 2012 14:06:58 +0000 (18:06 +0400)
* cord/cordxtra.c (CORD_ATTR_UNUSED): Use 'unused' attribute starting
from GCC v3.4 (instead of v4.0).
* include/private/gc_priv.h (GC_ATTR_UNUSED): Likewise.

cord/cordxtra.c
include/private/gc_priv.h

index 7b56a34ab8dcf514d9687108421b098723e13ffe..4231fd7ff5cf2d99b5d0afe7de565b5ed6f60290 100644 (file)
@@ -63,7 +63,7 @@ typedef void (* oom_fn)(void);
               ABORT("Out of memory\n"); }
 # define ABORT(msg) { fprintf(stderr, "%s\n", msg); abort(); }
 
-#if __GNUC__ >= 4
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
 # define CORD_ATTR_UNUSED __attribute__((__unused__))
 #else
 # define CORD_ATTR_UNUSED /* empty */
index 308fceb66418910ed8f986b3a456719452cc03f8..08f7880a3df1fb6048fea6ef4f5a83bcb982a218 100644 (file)
@@ -130,7 +130,7 @@ typedef char * ptr_t;   /* A generic pointer to which we can add        */
 #endif
 
 #ifndef GC_ATTR_UNUSED
-# if __GNUC__ >= 4
+# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
 #   define GC_ATTR_UNUSED __attribute__((__unused__))
 # else
 #   define GC_ATTR_UNUSED /* empty */