A compiler can output, i.e. “list” its input, together with any messages that it will generate, such as error messages. This is useful when you want a clear, verbose view of what a message is about, in context. IDEs will normally link message to code, but even today, considering Jacob's hint at computing history, a list can literally point out. Using a pragma List
, the programmer can exclude what does not need to be listed, if he or she knows. Or, exclude what should never be listed, for reasons of secrecy.
Listing first, then the original program text, with pragma List
:
Compiling: /some/path/some_proc.adb
Source file time stamp: 2017-01-30 08:30:40
Compiled at: 2017-01-30 09:30:42
1. procedure Some_Proc is
2. procedure Inner;
3. -- Does this and that...
4.
5. pragma List (Off);
10. pragma List (On);
11.
12. begin
13. Inner (42);
|
>>> too many arguments in call to "Inner"
14. end Some_Proc;
14 lines: 1 error
gprbuild: *** compilation phase failed
(If your compiler is GNAT, specify -gnatl
among the switches, for listing, and compile:)
procedure Some_Proc is
procedure Inner;
-- Does this and that...
pragma List (Off);
procedure Inner is
begin
null;
end Inner;
pragma List (On);
begin
Inner (42);
end Some_Proc;