Skip to content

Commit 691a913

Browse files
committed
Enable warnings and fix detected warnings.
1 parent 96a64b9 commit 691a913

12 files changed

+17
-36
lines changed

gnat/gnatdoc.gpr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ project GNATdoc is
3333
for Main use ("gnatdoc-driver.adb");
3434

3535
package Compiler is
36-
for Switches ("Ada") use ("-g", "-gnatygO", "-gnata");
36+
for Switches ("Ada") use ("-g", "-gnatygO", "-gnata", "-gnatwa");
3737
end Compiler;
3838

3939
package Builder is

gnat/libgnatdoc.gpr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ project LibGNATdoc is
2525
for Source_Dirs use ("../source");
2626

2727
package Compiler is
28-
for Switches ("Ada") use ("-g", "-gnatygO", "-gnata");
28+
for Switches ("Ada") use ("-g", "-gnatygO", "-gnata", "-gnatwa");
2929
end Compiler;
3030

3131
end LibGNATdoc;

source/backend/gnatdoc-backend-html.adb

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ with VSS.Strings.Conversions;
3030
with VSS.String_Vectors;
3131
with VSS.XML.Templates.Processors;
3232
with VSS.XML.Templates.Proxies.Strings;
33-
with VSS.XML.Templates.Values;
3433
with VSS.XML.XmlAda_Readers;
3534

3635
with GNATdoc.Comments.Helpers;
@@ -43,7 +42,6 @@ package body GNATdoc.Backend.HTML is
4342

4443
use GNAT.SHA256;
4544
use GNATCOLL.VFS;
46-
use GNATdoc.Comments.Helpers;
4745
use GNATdoc.Entities;
4846
use VSS.Strings.Conversions;
4947

@@ -91,12 +89,8 @@ package body GNATdoc.Backend.HTML is
9189

9290
package body Proxies is
9391

94-
use type VSS.String_Vectors.Virtual_String_Vector;
9592
use type VSS.Strings.Virtual_String;
9693

97-
type Entity_Information_Set_Proxy_Access is
98-
access all Entity_Information_Set_Proxy;
99-
10094
type TOC_Iterator is
10195
limited new VSS.XML.Templates.Proxies.Abstract_Proxy
10296
and VSS.XML.Templates.Proxies.Abstract_Iterable_Iterator
@@ -417,11 +411,8 @@ package body GNATdoc.Backend.HTML is
417411
(Self : in out HTML_Backend'Class;
418412
Entity : not null Entity_Information_Access)
419413
is
420-
Name : constant String :=
414+
Name : constant String :=
421415
Digest (To_UTF_8_String (Entity.Signature)) & ".html";
422-
File : Writable_File :=
423-
Create (Filesystem_String (Name)).Write_File;
424-
All_Nested : Entity_Information_Sets.Set;
425416

426417
begin
427418
declare

source/backend/gnatdoc-backend-html_markup.adb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
------------------------------------------------------------------------------
1717

1818
with VSS.XML.Events;
19-
with VSS.XML.Event_Vectors;
2019
with VSS.XML.Namespaces;
2120

2221
with Markdown.Block_Containers;

source/backend/streams.adb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
-- of the license. --
1616
------------------------------------------------------------------------------
1717

18-
with Ada.Streams;
19-
2018
with VSS.Stream_Element_Vectors.Conversions;
2119

2220
package body Streams is
@@ -51,12 +49,15 @@ package body Streams is
5149
Item : VSS.Characters.Virtual_Character;
5250
Success : in out Boolean)
5351
is
52+
pragma Unreferenced (Success);
53+
5454
Data : constant String :=
5555
VSS.Stream_Element_Vectors.Conversions.Unchecked_To_String
5656
(Self.Encoder.Encode (Item));
5757

5858
begin
5959
GNATCOLL.VFS.Write (Self.Writable, Data);
60+
-- Note, any errors are reported at the time of file close only.
6061
end Put;
6162

6263
end Streams;

source/frontend/gnatdoc-frontend.adb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,18 @@
1616
------------------------------------------------------------------------------
1717

1818
with Ada.Text_IO;
19-
with Ada.Wide_Wide_Text_IO;
2019

2120
with Libadalang.Common;
2221

2322
with VSS.Strings.Conversions;
2423

2524
with GNATdoc.Comments.Extractor;
26-
with GNATdoc.Comments.Options;
2725
with GNATdoc.Entities;
2826
with GNATdoc.Options;
2927

3028
package body GNATdoc.Frontend is
3129

3230
use GNATdoc.Comments.Extractor;
33-
use GNATdoc.Comments.Options;
3431
use Libadalang.Analysis;
3532
use Libadalang.Common;
3633
use VSS.Strings;

source/gnatdoc-comments-builders-subprograms.adb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
-- of the license. --
1616
------------------------------------------------------------------------------
1717

18-
with Libadalang.Common;
19-
2018
package body GNATdoc.Comments.Builders.Subprograms is
2119

2220
use Libadalang.Analysis;

source/gnatdoc-comments-builders.adb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ package body GNATdoc.Comments.Builders is
3838
Node : Basic_Decl'Class;
3939
Pattern : VSS.Regular_Expressions.Regular_Expression)
4040
is
41-
Node_Location : constant Source_Location_Range := Node.Sloc_Range;
42-
Location : Source_Location_Range;
41+
Location : Source_Location_Range;
4342

4443
begin
4544
-- Extract comments inside the declaration and fill text of raw,

source/gnatdoc-comments-extractor.adb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ package body GNATdoc.Comments.Extractor is
452452
Options : GNATdoc.Comments.Options.Extractor_Options)
453453
return not null Structured_Comment_Access is
454454
begin
455-
return Result : not null Structured_Comment_Access :=
455+
return Result : constant not null Structured_Comment_Access :=
456456
new Structured_Comment
457457
do
458458
Extract (Node, Options, Result.all);
@@ -1201,9 +1201,9 @@ package body GNATdoc.Comments.Extractor is
12011201
Options : GNATdoc.Comments.Options.Extractor_Options;
12021202
Documentation : in out Structured_Comment'Class)
12031203
is
1204-
Definition : Libadalang.Analysis.Task_Def'Class :=
1205-
Decl.F_Definition;
1206-
Is_Or_With_Token : Token_Reference;
1204+
Definition : constant
1205+
Libadalang.Analysis.Task_Def'Class := Decl.F_Definition;
1206+
Is_Or_With_Token : Token_Reference;
12071207

12081208
Leading_Section : Section_Access;
12091209
Trailing_Section : Section_Access;
@@ -1636,9 +1636,9 @@ package body GNATdoc.Comments.Extractor is
16361636
Line_Index : Positive;
16371637
Amount : VSS.Strings.Character_Count)
16381638
is
1639-
Line : Virtual_String := Text (Line_Index);
1640-
Iterator : Character_Iterator := Line.At_First_Character;
1641-
Count : Character_Count := Amount;
1639+
Line : constant Virtual_String := Text (Line_Index);
1640+
Iterator : Character_Iterator := Line.At_First_Character;
1641+
Count : Character_Count := Amount;
16421642

16431643
begin
16441644
while Iterator.Forward loop
@@ -2075,7 +2075,7 @@ package body GNATdoc.Comments.Extractor is
20752075

20762076
else
20772077
declare
2078-
Match : Regular_Expression_Match :=
2078+
Match : constant Regular_Expression_Match :=
20792079
Pattern.Match (Line);
20802080

20812081
begin
@@ -2106,7 +2106,7 @@ package body GNATdoc.Comments.Extractor is
21062106
Section.Text (J);
21072107
Iterator : Character_Iterator :=
21082108
Line.At_First_Character;
2109-
Success : Boolean;
2109+
Success : Boolean with Unreferenced;
21102110

21112111
begin
21122112
if Line.Character_Length > Indent then

source/gnatdoc-comments-helpers.ads

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
------------------------------------------------------------------------------
1717

1818
with VSS.String_Vectors;
19-
with VSS.Strings;
2019

2120
with Libadalang.Analysis;
2221

0 commit comments

Comments
 (0)