[m-dev.] diff: address fjh review comments for hlc.gc using MSVC

Peter Ross petdr at cs.mu.OZ.AU
Thu Jun 15 00:52:58 AEST 2000


Hi,


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


Estimated hours taken: 0.25

compiler/llds_out.m:
    Document output_c_file_intro_and_grade in the interface.

compiler/mlds_to_c.m:
    Document that ANSI/ISO C doesn't support empty arrays and
    structures, so the handling of them by mlds_to_c may not be
    correct.
    s/NULL/0/ when initializing empty arrays, to make it more likely
    that the C compiler will accept the initialization.

compiler/passes_aux.m:
    In invoke_shell_command call sh instead of bash.

scripts/mgnuc.in:
    Use the value of $COMPILER instead of $CC when determining the C
    compiler.


Index: compiler/llds_out.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/llds_out.m,v
retrieving revision 1.144
diff -u -r1.144 llds_out.m
--- compiler/llds_out.m	2000/06/08 07:58:49	1.144
+++ compiler/llds_out.m	2000/06/14 14:40:40
@@ -31,6 +31,13 @@
 		io__state, io__state).
 :- mode output_llds(in, in, in, di, uo) is det.
 
+	% output_c_file_intro_and_grade(SourceFileName, Version)
+	% outputs a comment which includes the settings used to generate
+	% the C file.  This is used by configure to check the any
+	% existing C files are consistent with the current
+	% configuration.  SourceFileName is the name of the file from
+	% which the C is generated, while Version is the version name
+	% of the mercury compiler.
 :- pred output_c_file_intro_and_grade(string, string, io__state, io__state).
 :- mode output_c_file_intro_and_grade(in, in, di, uo) is det.
 
Index: compiler/mlds_to_c.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_c.m,v
retrieving revision 1.39
diff -u -r1.39 mlds_to_c.m
--- compiler/mlds_to_c.m	2000/06/08 07:58:54	1.39
+++ compiler/mlds_to_c.m	2000/06/14 14:40:55
@@ -773,6 +773,8 @@
 mlds_needs_initialization(init_struct([_|_])) = yes.
 mlds_needs_initialization(init_array(_)) = yes.
 
+	% XXX ANSI/ISO C does not allow empty arrays or empty structs;
+	% what we do for them here is probably not quite right.
 :- pred mlds_output_initializer_body(mlds__initializer, io__state, io__state).
 :- mode mlds_output_initializer_body(in, di, uo) is det.
 
@@ -790,7 +792,7 @@
 	->
 			% The MS VC++ compiler only generates a symbol, if
 			% the array has a known size.
-		io__write_string("NULL")
+		io__write_string("0")
 	;
 		io__write_list(ElementInits,
 				",\n\t\t", mlds_output_initializer_body)
Index: compiler/passes_aux.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/passes_aux.m,v
retrieving revision 1.35
diff -u -r1.35 passes_aux.m
--- compiler/passes_aux.m	2000/06/08 07:58:58	1.35
+++ compiler/passes_aux.m	2000/06/14 14:40:57
@@ -407,7 +407,7 @@
 	{
 		use_win32
 	->
-		string__append_list(["bash -c '", Command0, " '"], Command)
+		string__append_list(["sh -c '", Command0, " '"], Command)
 	;
 		Command = Command0
 	},
@@ -438,7 +438,7 @@
 	% Are we compiling in a win32 environment?
 :- pred use_win32 is semidet.
 :- pragma c_code(use_win32,
-	[will_not_call_mercury],
+	[will_not_call_mercury, thread_safe],
 "
 #ifdef MR_WIN32
 	SUCCESS_INDICATOR = 1;
Index: scripts/mgnuc.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/mgnuc.in,v
retrieving revision 1.69
diff -u -r1.69 mgnuc.in
--- scripts/mgnuc.in	2000/06/08 07:59:11	1.69
+++ scripts/mgnuc.in	2000/06/14 14:41:10
@@ -366,8 +366,8 @@
 		# about using possibly uninitialized variables;
 		# there's no easy way to supress them except by
 		# disabling the warning.
-		case "$CC" in
-	    		*gcc*)
+		case "$COMPILER" in
+	    		gcc)
 				CHECK_OPTS="$CHECK_OPTS -Wno-uninitialized"
 			;;
 		esac

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