Re: Pragma Unreferenced in GNAT GPL 2008
- From: "Dmitry A. Kazakov" <mailbox@xxxxxxxxxxxxxxxxx>
- Date: Sat, 5 Jul 2008 09:57:37 +0200
On Sat, 05 Jul 2008 07:26:49 +0200, Wilhelm Spickermann wrote:
After installing GNAT GPL 2008 I get unexpected warnings on
unreferenced variables:
...
entry Wait (S : Event_State) when True is
begin
if S = On then
requeue Wait_On with abort;
else
requeue Wait_Off with abort;
end if;
end Wait;
entry Wait_On (S : Event_State) when Value = On is
pragma Unreferenced (S);
begin
null;
end Wait_On;
...
"pragma Unreferenced (S);" is honoured by GNAT GPL 2007 and seems
to be ignored by GNAT GPL 2008.
Maybe they just have removed it.
But Wait_On need no parameters. It is OK to requeue to a parameterless
entry (9.5.4(3))
P.S. In simple cases, you could try entry families:
type Event_State is (Signaled, Reset);
entry Wait (Event_State);
entry Wait (for S in Event_State) when S = Reset xor Value = On is
begin
null;
end Wait;
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
.
- Follow-Ups:
- Re: Pragma Unreferenced in GNAT GPL 2008
- From: Wilhelm Spickermann
- Re: Pragma Unreferenced in GNAT GPL 2008
- References:
- Pragma Unreferenced in GNAT GPL 2008
- From: Wilhelm Spickermann
- Pragma Unreferenced in GNAT GPL 2008
- Prev by Date: Pragma Unreferenced in GNAT GPL 2008
- Next by Date: Re: Units of measurement for Ada v2.7
- Previous by thread: Pragma Unreferenced in GNAT GPL 2008
- Next by thread: Re: Pragma Unreferenced in GNAT GPL 2008
- Index(es):