[m-rev.] Error in the C code generated by the compiler

Julien Fischer jfischer at opturion.com
Mon Jan 8 14:10:31 AEDT 2024


Hi Volker,

On Sun, 7 Jan 2024, Volker Wysk wrote:

> I have what I believe is a compiler bug. After I added a semaphore as an
> input argument to this predicate:
>
> :- pred process(
>    fis_args::in,
>    odbc.connection::in,
>    thread.channel.channel(work_message)::in,
>    thread.channel.channel(result_message)::in,
>    thread.semaphore.semaphore::in,
>    io::di, io::uo)
> is cc_multi.
>
> ... I get this compiler message:
>
> Mercury/cs/worker.c:237:1: error:
> ‘mercury_data_thread__semaphore__type_ctor_info_9_0’ undeclared here (not in
> a function); did you mean
> ‘mercury_data_thread__semaphore__type_ctor_info_semaphore_0’?
>
> There's no error message about the Mercury code, the problem occurs in the
> generated C code. Therefore I believe that it's a compiler bug.

If the error is occuring in C code generated by the Mercury compiler,
rather than say C code from body of a foreign_proc or foreign_code
pragam, then that's a bug.

> Should I send a program that reproduces the problem?

Yes please.

Julien.


More information about the reviews mailing list