Ada.Containers.Vectors不使用GNAT GPL 2017
我正在尝试编译以下代码:Ada.Containers.Vectors不使用GNAT GPL 2017,ada,gnat,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;
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;
过程插入
(容器:输入输出向量;
前:扩展_指数;
计数:计数类型:=1)
是
新项目:元素类型:=;--
看起来这个文件被篡改了
总结证据,
- 多个报告可以追溯到4.9.1版本,GNAT版本没有问题
- 初始化标记为
gnat--version
>gnat GPL 2017(20170515-63)没有问题。相反,我看到的是新项目:元素类型;--默认初始化值
。GNAT GPL 2017在这里也没有问题。(在Debian/Jessie上)我看不到GCC 4.9.1、5.2.0、6.1.0、7.1.0、8.0.0、GNAT GPL 2015、2016、2017(在macOS上)中的任何一条都是如此。@trashgood:像这样改变这一行是可行的。看起来这个文件被篡改了,虽然我不能说是怎么发生的代码>代码日期为2005-11-15!并且仍然存在于最新的GCC资料中。@SimonWright:我在2015年5月6日的GNAT GPL 2015
资料中注意到了同样的事情。