[Gc] Patch for gcc 3.4.1

Andrew Begel abegel at cs.berkeley.edu
Mon Jul 5 23:02:47 PDT 2004


So, gcc 3.4.1 is more permissive about where attributes can go than gcc 
3.3. The slightly modified patch is as follows:

--- /home/cs/abegel/download/gc6.3alpha4/include/gc_allocator.h 
2002-05-02 20:32:38.000000000 -0700
+++ gc_allocator.h      2004-07-05 16:35:38.000000000 -0700
@@ -36,6 +36,7 @@
   */

  #include "gc.h"        // For size_t
+#include "ansidecl.h"  // For ATTRIBUTE_UNUSED

  /* First some helpers to allow us to dispatch on whether or not a type
   * is known to be pointerfree.
@@ -118,7 +119,7 @@
    }

    // __p is not permitted to be a null pointer.
-  void deallocate(pointer __p, size_type GC_n)
+  void deallocate(pointer __p, size_type ATTRIBUTE_UNUSED GC_n)
      { GC_FREE(__p); }

    size_type max_size() const throw()

---------


Andrew Begel wrote:
> When compiling with gcc 3.4.1 and -Wall, the following patch is needed 
> to quiet a warning about an unused parameter to deallocate() in 
> gc_allocator.h.
> 
> Andrew
> 
> 
> --- /home/cs/abegel/download/gc6.3alpha4/include/gc_allocator.h 
> 2002-05-02 20:32:38.000000000 -0700
> +++ gc_allocator.h      2004-07-05 16:35:38.000000000 -0700
> @@ -36,6 +36,7 @@
>   */
> 
>  #include "gc.h"        // For size_t
> +#include "ansidecl.h"  // For ATTRIBUTE_UNUSED
> 
>  /* First some helpers to allow us to dispatch on whether or not a type
>   * is known to be pointerfree.
> @@ -118,7 +119,7 @@
>    }
> 
>    // __p is not permitted to be a null pointer.
> -  void deallocate(pointer __p, size_type GC_n)
> +  void deallocate(pointer __p, size_type GC_n ATTRIBUTE_UNUSED)
>      { GC_FREE(__p); }
> 
>    size_type max_size() const throw()
> 
> _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/



More information about the Gc mailing list