[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Query on linking order
From: |
john o goyo |
Subject: |
Query on linking order |
Date: |
Sun, 2 Jul 2023 14:01:11 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 |
Greetings, Gaius.
What is the linking order for gm2?
Reason: When linking, it seems that gm2 looks in the current directory
even though there is no reference to the current directoy.
Example: Note the following sequence.
[~/prj/tst]=> cat first.mod
MODULE first;
FROM InOut IMPORT WriteString, WriteLn;
BEGIN
WriteString("Modula-2. What else?"); WriteLn;
END first.
[~/prj/tst]=> cat IO.def
DEFINITION MODULE IO;
(*
* Test module for gm2 linking order.
*)
PROCEDURE Something(i :CARDINAL) :CARDINAL;
END IO.
[~/prj/tst]=> cat IO.mod
IMPLEMENTATION MODULE IO;
(*
* Test module for gm2 linking order.
*)
PROCEDURE Something(i :CARDINAL) :CARDINAL;
BEGIN
IF ODD(i) THEN RETURN i + 1
END Something;
END IO.
[~/prj/tst]=> gm2 -c first.mod
[~/prj/tst]=> gm2 first.mod
./IO.mod:10:5: warning: In procedure : syntax warning, missing
10 | END Something;
| ^~~~~~~~~
/home/build/gcc/13.1.0/lib/gcc/sparc-sun-solaris2.11/13.1.0/m2/m2pim/StdIO.mod:163:18:
error: In implementation module : unknown ident in the construction of a
qualident
163 | PushOutput(IO.Write) ;
| ^~~~~
/home/build/gcc/13.1.0/lib/gcc/sparc-sun-solaris2.11/13.1.0/m2/m2pim/StdIO.mod:164:17:
error: unknown ident in the construction of a qualident
164 | PushInput(IO.Read)
| ^~~~
It seems that gm2 tries to include the IO.mod is the current directory,
despite no directive to do so.
I could not find anything relevant in the gm2 documenation.
Please advise.
Sincerely,
john
- Query on linking order,
john o goyo <=