[Gc] Patch for gcc 3.4.1

Boehm, Hans hans.boehm at hp.com
Tue Jul 6 13:31:05 PDT 2004


Thanks.

Is ansidecl.h a standard header file?  I didn't get the impression
that it was.  If it isn't, it would be better to explicitly define
something like GC_ATTRIBUTE_UNUSED so that it expands into
something interesting only for gcc, and then to use that.

Hans

> -----Original Message-----
> From: gc-bounces at napali.hpl.hp.com
> [mailto:gc-bounces at napali.hpl.hp.com]On Behalf Of Andrew Begel
> Sent: Monday, July 05, 2004 11:03 PM
> To: Andrew Begel
> Cc: gc at napali.hpl.hp.com
> Subject: Re: [Gc] Patch for gcc 3.4.1
> 
> 
> 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/
> 
> _______________________________________________
> 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