Re[2]: [Gc] boehm-gc patch

Ivan Maidanski ivmai at mail.ru
Sun Dec 13 23:00:37 PST 2009


Hi!
Ben Elliston <bje at au1.ibm.com> wrote:
> Hi Ivan
> 
> On Tue, 2009-12-01 at 22:16 +0300, Ivan Maidanski wrote:
> 
> > -#	define SIG_DEL(set, signal) sigdelset(&(set), (signal))
> > -#	define SIG_FILL(set) sigfillset(&set)
> > -#	define SIGSETMASK(old, new) sigprocmask(SIG_SETMASK, &(new), &(old))
> > +#       error undetectable signal API
> >  #   endif
> >  
> > I'm sorry this seems to be version 6.x as there is no SIG_FILL/DEL()
> > in the GC at present. Could you re-post it against the BDWGC CVS.
> 
> Rather than bother to find the relevant code in the CVS tree, I just
> built the whole GC using my new system compiler.  There is not much
> sense chasing these warnings in the version used by GCC, I suppose.

(I hope gcc/boehm-gc will be upgraded to v7+ one day...)

> 
> The only warning I get is:
>   cord/cordxtra.c:577: warning: ignoring return value of 'fread', declared with attribute warn_unused_result

I don't think it's worth bothering compilation warnings in the cord stuff (which is most really used as a gc test and hasn't been updated since 2005, at least).
So, I don't want to apply the patch. Hans might have a different opinion?

> 
> which I propose to fix with this patch:
> 
> Index: cord/cordxtra.c
> ===================================================================
> RCS file: /cvsroot/bdwgc/bdwgc/cord/cordxtra.c,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 cordxtra.c
> --- cord/cordxtra.c	10 Oct 2005 22:33:34 -0000	1.1.1.1
> +++ cord/cordxtra.c	14 Dec 2009 00:31:33 -0000
> @@ -574,7 +574,8 @@ CORD CORD_from_file_lazy_inner(FILE * f,
>  	/* world is multithreaded.			*/
>  	char buf[1];
>  
> -	(void) fread(buf, 1, 1, f); 
> +	/* This `if' construct avoids a warning from GCC. */
> +	if (fread(buf, 1, 1, f)) { }

This looks ugly.

>  	rewind(f);
>      }
>      state -> lf_file = f;

Bye.


More information about the Gc mailing list