【发布时间】:2018-01-04 04:19:29
【问题描述】:
一般来说,如果您尝试取消引用空指针(访问类型),Ada 将引发Constraint_Error。但是,如果您正在使用 pragma Suppress (all_checks),则此行为将被禁用。
在这种情况下,如何检查访问类型是否指向0x0 (null)?
考虑以下几点:
type My_Access_Type is access all My_Type'Class;
procedure myProcedure ( myAccess : in My_Access_Type ) is
begin
-- need to have check in here
end
【问题讨论】: