[m-dev.] Re: diff: fix bug in c_pointer changes

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Jul 3 20:58:40 AEST 1999


On 03-Jul-1999, Fergus Henderson <fjh at cs.mu.oz.au> wrote:
> Estimated hours taken: 0.75
> 
> runtime/mercury_bootstrap.c:
> 	Fix a bug: the INIT line was missing the `_bootstrap' suffix that
> 	is needed to distinguish this module from the real one.
> 	This was causing the initialization for unify_c_pointer_module()
> 	to be run twice, rather than having it run once and having the
> 	initialization for unify_c_pointer_module_bootstrap() run once.
> 	This in turn caused the Mercury profiler to fail.

Also the function sys_init_unify_c_pointer_module_bootstrap() was missing.
So the change needed was a little bit more complicated than I first thought.

Index: mercury_bootstrap.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_bootstrap.c,v
retrieving revision 1.12
diff -u -u -r1.12 mercury_bootstrap.c
--- mercury_bootstrap.c	1999/06/24 04:32:17	1.12
+++ mercury_bootstrap.c	1999/07/03 10:54:25
@@ -97,5 +97,12 @@
 
 /* Ensure that the initialization code for the above module gets run. */
 /*
-INIT sys_init_unify_c_pointer_module
+INIT sys_init_unify_c_pointer_module_bootstrap
 */
+
+extern ModuleFunc unify_c_pointer_module_bootstrap;
+void sys_init_unify_c_pointer_module_bootstrap(void);
+	/* duplicate declaration to suppress gcc -Wmissing-decl warning */
+void sys_init_unify_c_pointer_module_bootstrap(void) {
+	unify_c_pointer_module_bootstrap();
+}

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- 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