[m-rev.] diff: carve string.{from,to}_int.m out of string.m

Peter Wang novalazy at gmail.com
Wed Sep 16 17:47:29 AEST 2026


On Wed, 16 Sep 2026 02:07:17 +0200 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> The concept has been agreed and the details are trivial,
> so no review is needed.
> 
> Zoltan.

When the attached program is built in a high-level C grade with
intermodule optimisation enabled, we get an error about an implicit
function declaration:

    % mmc -s hlc.gc --intermod-opt -m t1
    ...
    Mercury/cs/t1.c: In function 'main_2_p_0':
    Mercury/cs/t1.c:213:15: error: implicit declaration of function
    'mercury__string__to_int__do_base_string_to_int_3_p_0';
    did you mean 'string__to_int__do_base_string_to_int_3_p_0'?
    [-Wimplicit-function-declaration]

The program just calls string.to_int/2.

string.opt contains:

    string.to_int(V_3, V_4) :-
	V_5 = 10 : int,
	string.to_int.do_base_string_to_int(V_5, V_3, V_4).

string.to_int.mih contains:

    MR_bool MR_CALL 
    string__to_int__do_base_string_to_int_3_p_0(
      MR_Integer param_1,
      MR_String param_2,
      MR_Integer * param_3);

I don't remember what the "mercury__" prefix is about,
but I guess it is missing.

Peter
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: t1.m
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20260916/b0ea579d/attachment.ksh>


More information about the reviews mailing list