[Gc] boehm-gc patch

Ben Elliston bje at au1.ibm.com
Sun Dec 13 16:32:23 PST 2009


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.

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

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)) { }
 	rewind(f);
     }
     state -> lf_file = f;




More information about the Gc mailing list