"requires body" 个警告
"requires body" warnings
我有如下内容:
package ID_Count_Hashed_Map is new Ada.Containers.Hashed_Maps
(Key_Type => ID,
Element_Type => Count,
Hash => Hash,
Equivalent_Keys => "=");
如果我尝试使用 -gnatw.e
进行编译,我会收到如下警告:
info: in instantiation at a-cohama.ads:73
info: "ID_Count_Hashed_Map" requires body ("Has_Element" requires completion)
info: in instantiation at a-cohama.ads:79
info: "ID_Count_Hashed_Map" requires body ("=" requires completion)
info: in instantiation at a-cohama.ads:90
info: "ID_Count_Hashed_Map" requires body ("Capacity" requires completion)
...
这些警告是什么意思?我在哪里可以在文档中找到它们?而且,如果它们与我的代码无关,我该如何关闭它们同时仍然保留 -gnatw.e
的其余部分?
您可能会在 GNAT User's Guide
中找到记录的消息
引自指南:
The use of this switch is not recommended for normal use.
用户指南继续建议使用 -gnatwa
。
我有如下内容:
package ID_Count_Hashed_Map is new Ada.Containers.Hashed_Maps
(Key_Type => ID,
Element_Type => Count,
Hash => Hash,
Equivalent_Keys => "=");
如果我尝试使用 -gnatw.e
进行编译,我会收到如下警告:
info: in instantiation at a-cohama.ads:73 info: "ID_Count_Hashed_Map" requires body ("Has_Element" requires completion) info: in instantiation at a-cohama.ads:79 info: "ID_Count_Hashed_Map" requires body ("=" requires completion) info: in instantiation at a-cohama.ads:90 info: "ID_Count_Hashed_Map" requires body ("Capacity" requires completion) ...
这些警告是什么意思?我在哪里可以在文档中找到它们?而且,如果它们与我的代码无关,我该如何关闭它们同时仍然保留 -gnatw.e
的其余部分?
您可能会在 GNAT User's Guide
中找到记录的消息引自指南:
The use of this switch is not recommended for normal use.
用户指南继续建议使用 -gnatwa
。