[Gc] Patch for gcc 3.4.1

Boehm, Hans hans.boehm at hp.com
Wed Jul 7 13:54:34 PDT 2004


Thanks.  I put this in with some minor stylistic changes.

There's a second definition of deallocate later in the file which
presumably needs the same treatment.  I did that as well.

Hans

> -----Original Message-----
> From: Andrew Begel [mailto:abegel at eecs.berkeley.edu]
> Sent: Tuesday, July 06, 2004 4:29 PM
> To: Boehm, Hans
> Cc: gc at napali.hpl.hp.com
> Subject: Re: [Gc] Patch for gcc 3.4.1
> 
> 
> Ok, try this patch. It's ansidecl.h free and not written using it.
> 
> Andy
> 
> 
> --- gc_allocator.h      Wed May  5 10:56:52 2004
> +++ ../../gc6.3alpha6-andy/include/gc_allocator.h       Tue Jul  6 
> 16:22:36 2004
> @@ -41,6 +41,12 @@
> 
>   #include "gc.h"        // For size_t
> 
> +#if defined(__GNUC__)
> +#define ATTR_UNUSED __attribute__((unused))
> +#else
> +#define ATTR_UNUSED
> +#endif
> +
>   /* First some helpers to allow us to dispatch on whether or 
> not a type
>    * is known to be pointerfree.
>    * These are private, except that the client may invoke the
> @@ -122,7 +128,7 @@
>     }
> 
>     // __p is not permitted to be a null pointer.
> -  void deallocate(pointer __p, size_type GC_n)
> +  void deallocate(pointer __p, size_type ATTR_UNUSED GC_n)
>       { GC_FREE(__p); }
> 
>     size_type max_size() const throw()
> 
> 
> ---------------------
> 
> 
> 
> On Jul 6, 2004, at 3:31 PM, Boehm, Hans wrote:
> 
> > I suspect it was added by someone who packaged 6.3alpha6 for a
> > specific OS distribution?  It's not in the version in
> >
> > http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source
> >
> > And the version I found on my Linux box is GPL'ed, which would make
> > me a bit nervous, mostly because I'm not sure how to interpret that
> > for a file like this.
> >
> > Hans
> >
> >> -----Original Message-----
> >> From: Andrew Begel [mailto:abegel at eecs.berkeley.edu]
> >> Sent: Tuesday, July 06, 2004 1:36 PM
> >> To: Boehm, Hans
> >> Cc: gc at napali.hpl.hp.com
> >> Subject: Re: [Gc] Patch for gcc 3.4.1
> >>
> >>
> >> ansidecl.h is in gc6.3alpha6/include, and when I did a make
> >> install of
> >> gc, it went into the same directory as gc_config_macros.h, which is
> >> included by gc.h.
> >>
> >> Andy
> >>
> >> On Jul 6, 2004, at 1:31 PM, Boehm, Hans wrote:
> >>
> >>> 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/
> >>>>
> >>> _______________________________________________
> >>> 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