comp.lang.ada
 help / color / mirror / Atom feed
* Unreferenced parameters
@ 2021-02-03 18:20 Simon Wright
  2021-02-03 18:50 ` Egil H H
  2021-02-04  3:12 ` Randy Brukardt
  0 siblings, 2 replies; 14+ messages in thread
From: Simon Wright @ 2021-02-03 18:20 UTC (permalink / raw)


In gps-editors.ads:1492, in GNAT Studio, I have

   overriding function Expand_Tabs
     (This   : Dummy_Editor_Buffer;
      Line   : Editable_Line_Type;
      Column : Character_Offset_Type) return Visible_Column_Type is (0);

and FSF GCC 10.1.0 says

 gps-editors.ads:1494:07: warning: formal parameter "Line" is not referenced
 gps-editors.ads:1495:07: warning: formal parameter "Column" is not referenced

which is clearly the case (how does it know that it's OK not to
reference This? it must check the context).

The compilation is set to treat warnings as errors (-gnatwe) so I need
to suppress these warnings.

I could do so with pragma Warnings (Off, "formal*not referenced");

I have done so by renaming the parameters Dummy_Line, Dummy_Column.

But is there a way of using aspect or pragma Unreferenced? Putting
pragma Unreferenced after the function definition doesn't work.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-02-11 20:18 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-03 18:20 Unreferenced parameters Simon Wright
2021-02-03 18:50 ` Egil H H
2021-02-03 18:53   ` Egil H H
2021-02-03 19:29     ` Dmitry A. Kazakov
2021-02-04 10:48       ` Simon Wright
2021-02-03 19:32     ` Simon Wright
2021-02-03 22:27       ` Shark8
2021-02-04  3:12 ` Randy Brukardt
2021-02-04 10:27   ` Simon Wright
2021-02-09 11:16     ` Egil H H
2021-02-09 18:54       ` Stephen Leake
2021-02-09 21:20         ` Simon Wright
2021-02-11  3:20         ` Randy Brukardt
2021-02-11 20:18           ` Stephen Leake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox