我刚刚在 Linux 上安装了 alr。 大约 10 年没有使用 ada,发现 gnat 社区不再受支持。 输入以下程序
with Ada.Text_IO;
procedure A02hello is
begin
Ada.Text_IO.Put_Line("It works");
end A02hello;
收到以下编译警告
Compile
[Ada] a02hello.adb
a02hello.adb:5:24: (style) space required [-gnatyt]
如果我将 put_line 更改为
Ada.Text_IO.Put_Line ("It works");
警告消失。
我在 https://gcc.gnu.org/onlinedocs/gcc-9.3.0/gnat_ugn/Style-Checking.html 中查找了 -gnatyt 。 说需要一个空间。
如何关闭 alr 中的 -gnatyt。
您可以关闭所有检查:
[build-switches]
"*".style_checks = "No"
或者,您可以设置自己的样式检查。我通常将行长设置为120:
"*".style_checks = ["-gnatyM120"]