[m-rev.] diff: util/mkinit.c: avoid lcc string literal length limit

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Feb 4 11:32:59 AEDT 2002


Estimated hours taken: 0.5
Branches: main

util/mkinit.c:
	Split up a long string literal, to avoid overflowing a fixed limit in
	lcc.

Workspace: /home/earth/fjh/ws-earth4/mercury
Index: util/mkinit.c
===================================================================
RCS file: /home/mercury1/repository/mercury/util/mkinit.c,v
retrieving revision 1.83
diff -u -d -r1.83 mkinit.c
--- util/mkinit.c	30 Jan 2002 05:09:13 -0000	1.83
+++ util/mkinit.c	4 Feb 2002 00:28:32 -0000
@@ -228,7 +228,7 @@
 	"static int MR_do_load_aditi_rl_code(void);\n"
 	;
 
-static const char mercury_funcs[] =
+static const char mercury_funcs1[] =
 	"\n"
 	"#ifdef MR_HIGHLEVEL_CODE\n"
 	"  extern void MR_CALL %s(void);\n"
@@ -292,7 +292,9 @@
 	"	libmercury_impure_ptr = _impure_ptr;\n"
 	"  #endif\n"
 	"#endif\n"
-	"\n"
+	"\n";
+
+static const char mercury_funcs2[] =
 	"	MR_address_of_mercury_init_io = mercury_init_io;\n"
 	"	MR_address_of_init_modules = init_modules;\n"
 	"	MR_address_of_init_modules_type_tables = init_modules_type_tables;\n"
@@ -362,7 +364,7 @@
 	"#endif\n"
 	;
 
-static const char mercury_funcs2[] =
+static const char mercury_funcs3[] =
 	"\n"
 	"	mercury_runtime_init(argc, argv);\n"
 	"	return;\n"
@@ -828,8 +830,8 @@
 		aditi_load_func = "NULL";
 	}
 	
-	printf(mercury_funcs, hl_entry_point, entry_point,
-		aditi_load_func, hl_entry_point, entry_point);
+	printf(mercury_funcs1, hl_entry_point, entry_point);
+	printf(mercury_funcs2, aditi_load_func, hl_entry_point, entry_point);
 
 	printf("	MR_runtime_flags = \"");
 	for (list_tmp = runtime_flags;
@@ -854,7 +856,7 @@
 	}
 	printf("\";\n");
 
-	fputs(mercury_funcs2, stdout);
+	fputs(mercury_funcs3, stdout);
 
 	if (output_main_func) {
 		fputs(main_func, stdout);

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list