Files
mercury/tests/valid/int64.m
Fergus Henderson 6f1f6bcb17 Fix some bugs where we were not properly escaping special characters in
Estimated hours taken: 0.75

Fix some bugs where we were not properly escaping special characters in
C strings in the generated code.

compiler/llds_out.m:
	Change a number of places to call output_quoted_c_string instead of
	io__write_string, so that special characters will be properly escaped.
	Add new predicate llds_out__quote_c_string, for use by pragma_c_gen.m.

compiler/pragma_c_gen.m:
	Call llds_out__quite_c_string, to ensure that special characters
	in the generated "pragma_c_raw_code" are properly escaped.

tests/valid/int64.m:
tests/valid/Mmakefile:
	Regression test for the above-mentioned bug fix.
1999-01-27 08:34:38 +00:00

19 lines
397 B
Mathematica

% A development version of the Mercury compiler generated
% invalid C code for this example, because it didn't properly
% escape special characters such as \ in some of the C strings
% that it generated.
:- module int64.
:- interface.
:- type int64.
:- func int64 /\ int64 = int64.
:- implementation.
:- type int64 == int.
:- pragma c_code((A::in) /\ (B::in) = (C::out), [], "C = A & B;").