Ada.Containers.Vectors不使用GNAT GPL 2017

时间:2017-09-25 18:10:57

标签: ada gnat

我正在尝试编译此代码:

with Ada.Containers.Vectors;

procedure Test is
   type My_Type is range -1 .. Integer'Last;
   package My_Vectors is new Ada.Containers.Vectors (Positive, My_Type);
   Vector : My_Vectors.Vector;
begin
   Vector.Append (-1);
end Test;

gnatmake test.adb给出了这个输出:

gcc -c test.adb
a-convec.adb:1553:33: missing operand
gnatmake: "test.adb" compilation error

错误消息导致stdlib实现中的此过程:

   procedure Insert
     (Container : in out Vector;
      Before    : Extended_Index;
      Count     : Count_Type := 1)
   is
      New_Item : Element_Type := <>;  --  << here
      pragma Warnings (Off, New_Item);

   begin
      Insert (Container, Before, New_Item, Count);
   end Insert;

看起来很好。我不明白错误信息,这里有什么问题?这是stdlib中的错误吗?

1 个答案:

答案 0 :(得分:2)

  

看起来此文件已被篡改......

总结证据,

  • 多个comments报告GNAT版本回溯到4.9.1没问题。

  • 标记为<< here的初始化是编译时错误,因为名为compound delimiter <>在{中无效} {3}}中使用的{3}}。

  • 根据expressiona-convec.adb只有在相应的.ali文件后被修改后才会重新编译。

前进,你可能

  • 分别查看a-convec.adba-convec.ali目录中adaincludeadalib的修改日期。

  • 重新安装编译器。

  • 如果有必要,请通知上游维护人员。