gpt4 book ai didi

ada - GNAT 附带的 AUnit 中的错误

转载 作者:行者123 更新时间:2023-12-05 03:51:11 24 4
gpt4 key购买 nike

我相信我已经发现并修复了 AUnit 中的一个错误,它是 Ada 的 GNAT 编译器工具的一部分。

向 AdaCore 提交 GNAT 工具社区版本错误的最佳方式是什么?

以下程序使用当前版本的编译器 GNAT Community 2020 (20200429-84) 静默中止

with Ada.Text_IO;use Ada.Text_IO;
with AUnit.Test_Filters;
with AUnit.Tests;

procedure Message_Allocation is

package Filter_Package is
type Filter_Type is new AUnit.Test_Filters.Name_Filter with null record;

function Is_Active
(Filter : Filter_Type;
T : AUnit.Tests.Test'Class) return Boolean;

end Filter_Package;

package body Filter_Package is
function Is_Active
(Filter : Filter_Type;
T : AUnit.Tests.Test'Class) return Boolean is begin return true; end is_active;
end Filter_Package;

filter : Filter_Package.filter_type;

begin
Put_Line ("set 1st filter");
filter.set_name ("abc");
Put_Line ("set 2nd filter");
filter.set_name ("xyz");
Put_Line ("2nd filter set");

end Message_Allocation;

该错误存在于文件 aunit.adb 中的过程 Message_Free 中。以下是补丁版本。更改是调用 AUnit.Memory.AUnit_Free 的参数。

   procedure Message_Free (Msg : in out Message_String) is
begin
if Msg /= null then
AUnit.Memory.AUnit_Free (Msg.all'address - System.Address'size/8);
Msg := null;
end if;
end Message_Free;

最佳答案

邮寄至:report (at)(制作 GNAT 的公司名称).com

您可以使用有意义的标题和有用的信息来展示错误(通常是重现器示例)和您的修复,从而增加机会。

关于ada - GNAT 附带的 AUnit 中的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63100046/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com