This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Ada question about PR 18434
- From: Laurent GUERBY <laurent at guerby dot net>
- To: Robert Dewar <dewar at adacore dot com>, Arnaud Charlet <charlet at adacore dot com>
- Cc: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>, gcc at gcc dot gnu dot org
- Date: Fri, 30 Sep 2005 22:28:48 +0200
- Subject: Ada question about PR 18434
Rainer tracing seems to show that strange thing happen to
Osint.Running_Program during elaboration of 4.0.x. We have:
package body Osint is
Running_Program : Program_Type := Unspecified;
...
procedure Set_Program (P : Program_Type) is
begin
...
Running_Program := P;
end Set_Program;
...
package body Osint.M is
...
begin
Set_Program (Make);
end Osint.M;
However I see no reason why Osint body elaboration must be done
before Osint.M body elaboration, it seems to me that the
binder could perfectly choose to elaborate Osint.M body
before Osint body, and this would leave Running_Program
with the "wrong" value Rainer observes when gnatmake is running.
If I'm guessing correctly there are two solutions:
1/ Remove the default initialization in ada/osint.adb
- Running_Program : Program_Type := Unspecified;
+ pragma Warnings (Off);
+ Running_Program : Program_Type;
+ pragma Warnings (On);
This is not a long term solution, but local and should fix the problem
if my hypothesis is correct, Rainer could you try this one?
2/ Use elaboration pragma, like may be a pragma Elaborate_Body
in ada/osint.ads but this requires a more global knowledge of
what happens during compiler tools elaboration.
Arnaud, Robert?
Thanks in advance,
Laurent