[m-dev.] trivial diff: work-around gcc 2.95.2 bug

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Oct 23 06:23:05 AEDT 2000


Estimated hours taken: 0.25

library/io.m:
	Work around a gcc 2.95.2 bug on i*86: use MR_memcpy() rather
	than structure assignment.

Workspace: /home/pgrad/fjh/ws/hg
Index: library/io.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/io.m,v
retrieving revision 1.209
diff -u -d -r1.209 io.m
--- library/io.m	2000/10/17 01:33:23	1.209
+++ library/io.m	2000/10/22 19:01:08
@@ -3021,7 +3021,11 @@
 		** Doing this ensures that future accesses to the file
 		** will fail nicely.
 		*/
-		*mf = MR_closed_stream;
+		/*
+		** gcc 2.95.2 barfs on `*mf = MR_closed_stream;'
+		** so we use MR_memcpy() instead.
+		*/
+		MR_memcpy(mf, &MR_closed_stream, sizeof(*mf));
 
 /*
 ** XXX it would be nice to have an autoconf check

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list