[m-dev.] diff: bug fix for std_util.m failed in grade hlc.gc

Peter Ross peter.ross at miscrit.be
Tue Jul 25 19:44:38 AEST 2000


On Tue, Jul 25, 2000 at 05:57:24PM +1000, Robert Jeschofnik wrote:
> I (perhaps too) boldly set a make; make install going last night that I
> started with "configure --enable-all-grades", and went to bed. Upon checking
> it today, I found the following message greeting me..
> 
> MERCURY_INT_DIR=. MERCURY_ALL_C_INCL_DIRS=" -I../trace -I../runtime -I../boehm_gc -I../boehm_gc/include " ../scripts/mgnuc --grade hlc.gc            -c std_util.c -o std_util.o
> std_util.m: In function `ML_type_name':
> std_util.m:1371: warning: passing arg 1 of `mercury__std_util__type_name_2_f_0' makes integer from pointer without a cast
> std_util.m:1371: too few arguments to function `mercury__std_util__type_name_2_f_0'                                                                             gmake[2]: *** [std_util.o] Error 1
> gmake[2]: Leaving directory `/mnt/ender/home/ender2/rejj/work/ws4/library'
> 
> 
> Not really what I wanted to see. In any case, I've had a bit of a look but
> cannot track down what is going on here - the name
> "mercury__std_util__type_name_2_f_0" doesn't even seem to exist anywhere in
> the generated std_util.c, and there doesn't seem to be anything blatantly wrong
> with the code for type_name/2 in std_util.m...
> 
> Could someone have a look into this?
> 


===================================================================


Estimated hours taken: 1

Fix a bug reported by Robert Jeschofnik <rejj at students.cs.mu.oz.au>.

compiler/mlds_to_c.m:
    Fix a bug where when generating code for functions in the form of
    `:- func <Name>(...) = T is det' the list of arguments for the
    exported function was being used as the list of arguments for calling
    the MLDS function.

Index: mlds_to_c.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_c.m,v
retrieving revision 1.44
diff -u -r1.44 mlds_to_c.m
--- mlds_to_c.m	2000/07/24 11:46:33	1.44
+++ mlds_to_c.m	2000/07/25 09:33:24
@@ -493,19 +493,20 @@
 
 mlds_output_pragma_export_func_defn_body(ModuleName, FuncName, Signature) -->
 	{ ExportedSignature = det_func_signature(Signature) },
-	{ ExportedSignature = mlds__func_params(Parameters, RetTypes) },
+	{ ExportedSignature = mlds__func_params(_ExpParameters, ExpRetTypes) },
+	{ Signature = mlds__func_params(Parameters, _RetTypes) },
 
-	( { RetTypes = [RetType0] } ->
-		{ RetType = RetType0 }
+	( { ExpRetTypes = [ExpRetType0] } ->
+		{ ExpRetType = ExpRetType0 }
 	;
 		{ error("mlds_output_pragma_export_func_defn_body") }
 	),
 
 		% Define a variable to hold the function result.
 	io__write_string("\t"),
-	mlds_output_type_prefix(RetType),
+	mlds_output_type_prefix(ExpRetType),
 	io__write_string(" arg"),
-	mlds_output_type_suffix(RetType),
+	mlds_output_type_suffix(ExpRetType),
 	io__write_string(";\n"),
 
 		% Call the MLDS function.
@@ -518,8 +519,8 @@
 		% return the function result.
 	io__write_string("\t"),
 	io__write_string("return ("),
-	mlds_output_pragma_export_type(prefix, RetType),
-	mlds_output_pragma_export_type(suffix, RetType),
+	mlds_output_pragma_export_type(prefix, ExpRetType),
+	mlds_output_pragma_export_type(suffix, ExpRetType),
 	io__write_string(") arg;\n").
 
 	%

--------------------------------------------------------------------------
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