关于使用 Ada 的包体要求的令人困惑的 "info" 消息?

Puzzling "info" message regarding package body requirement using Ada?

我在开发二维码生成器的早期阶段遇到了来自 GNAT 7.4.0(运行 在 "Ubuntu 19.04" 系统上)的奇特 "info" 消息。

我正在使用一些相当激进的编译开关:

gnatmake -gnata -gnateE -gnateF -gnatf -gnato -gnatv -gnatVa -gnaty -gnatwe -gnatw.e main.adb

我的代码构建没有错误,但此信息消息确实表明我没有为包提供正文 "qr_symbol"。

qr_symbol.ads

with QR_Versions; use QR_Versions;

generic
   Ver : QR_Version;
package QR_Symbol is
   procedure Export_As_SVG;
private
   type Module_State is (
     Uncommitted,
     One,
     Zero
     );

   type Module_Family is (
     Uncommitted,
     Finder,
     Separator,
     Alignment,
     Timing,
     Format_Spec,
     Version_Spec,
     Data_Codeword,
     EC_Codeword,
     Padding
     );

   type Module is
      record
         State : Module_State := Uncommitted;
         Family : Module_Family := Uncommitted;
      end record;

   type Module_Matrix is array (
     Positive range <>,
     Positive range <>
     ) of Module;

end QR_Symbol;

qr_symbol.adb

with Ada.Text_IO; use Ada.Text_IO;

package body QR_Symbol is
   Version : constant QR_Version := Ver; --  Ver is a formal generic parameter
   Side_Length : constant Positive := 17 + (Positive (Ver) * 4);
   Matrix : Module_Matrix (1 .. Side_Length, 1 .. Side_Length);

   procedure Export_As_SVG is
   begin
      Put_Line ("in Export_As_SVG()...");
      Put_Line ("  Version: " & Version'Image);
      Put_Line ("  Side_Length: " & Side_Length'Image);

      --  Matrix (1, 1).State := One;
      Put_Line ("  Matrix (1, 1).State: " & Matrix (1, 1).State'Image);

   end Export_As_SVG;
end QR_Symbol;

And here's the info output that I do not understand...

GNAT 7.4.0
Copyright 1992-2017, Free Software Foundation, Inc.

Compiling: qr_symbol.adb
Source file time stamp: 2019-12-07 16:29:37
Compiled at: 2019-12-07 16:29:38

==============Error messages for source file: qr_symbol.ads
     9.    procedure Export_As_SVG;
                     |
        >>> info: "QR_Symbol" requires body ("Export_As_SVG" requires completion)

 29 lines: No errors, 1 info message
aarch64-linux-gnu-gnatbind-7 -x main.ali
aarch64-linux-gnu-gnatlink-7 main.ali

Program output (given correct input, does gives correct output)...

$ ./main '' V1
QR Version requested: V 1
in Export_As_SVG()...
  Version:  1
  Side_Length:  21
  Matrix (1, 1).State: UNCOMMITTED

问题: 为什么明明我已经这样做了,却出现提示我需要为此包提供正文的信息消息?

信息消息不用于建议您更改程序,仅用于提供一些(有用或无用)信息。在你的情况下,信息是真实的。如果不满足,就会出错。

您可能需要检查此标志是否导致生成此消息:

根据GNAT User's Guide

-gnatw.e `Activate every optional warning.'

This switch activates all optional warnings, including those which are not activated by -gnatwa. The use of this switch is not recommended for normal use. If you turn this switch on, it is almost certain that you will get large numbers of useless warnings. The warnings that are excluded from -gnatwa are typically highly specialized warnings that are suitable for use only in code that has been specifically designed according to specialized coding rules.

如果您不想删除该开关,至少您可以禁用此特定信息消息:

-gnatw.Y

`Disable information messages for why package spec needs body.'

This switch suppresses the output of information messages showing why a package specification needs a body.