[m-users.] C target compiler error (.mih file not updated)
Flo
bcdabgf.gfecdb at orange.fr
Sun Jan 25 23:58:47 AEDT 2026
Hi, I'm new to Mercury, coming from a background in functional programming (Haskell, OCaml, Agda).
I'm currently making my way through the reference manual and studying the library code.
I'm writing to comment on a puzzle I had this morning when compiling a little test.
I wrote a first module m1, I compiled it with `mmc --make m1.m`,
this generated a `m1.mih` file.
Then I modified m1, then created a module m2 which imports m1, and compiled m2 with `mmc --make m2`.
The `m1.mih` file was not updated in this process, despite the fact that `m1.m`'s interface had changed.
and as a result, the C compiler complained about conflicting types.
I consider this to be problematic: ideally any error should be caught by the Mercury compiler.
If compilation succeeds, the target code it generates should be then compile without errors using the corresponding target compilers.
why wasn't `m1.mih` updated? in fact it's not even needed: when I deleted it, and ran `mmc --make m2` again,
that file wasn't even produced. It seems to be produced only when I compile with `mmc --make m1.m`.
More information about the users
mailing list