[m-dev.] diff: cast string_const rvals to MR_String

Peter Ross peter.ross at miscrit.be
Fri Jul 14 01:08:35 AEST 2000


Hi,


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


Estimated hours taken: 0.1

compiler/mlds_to_c.m:
    When outputing a string_const add a cast to MR_String.
    This avoids the spurious gcc warning
        "assignment discards qualifiers from pointer target type"

Index: mlds_to_c.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_c.m,v
retrieving revision 1.40
diff -u -r1.40 mlds_to_c.m
--- mlds_to_c.m	2000/06/14 14:54:07	1.40
+++ mlds_to_c.m	2000/07/13 15:05:21
@@ -2378,6 +2378,9 @@
 	io__write_string("(Float) "),
 	io__write_float(FloatVal).
 mlds_output_rval_const(string_const(String)) -->
+	% the cast avoids the following gcc warning
+	% "assignment discards qualifiers from pointer target type"
+	io__write_string("(MR_String) "),
 	io__write_string(""""),
 	c_util__output_quoted_string(String),
 	io__write_string("""").

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