This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] No_Relative_Delay forbids Set_Handler calls


A call to Ada.Real_Time.Timing_Events.Set_Handler violates
restriction No_Relative_Delay (AI-0211). This patch
implements this interpertation.

The following compiled with -gnat05 -gnatws:

pragma Restrictions (No_Relative_Delay);
with Ada.Real_Time; use Ada.Real_Time;
with Ada.Real_Time.Timing_Events;
use  Ada.Real_Time.Timing_Events;
procedure NoRelDel is
   TE  : Timing_Event;
   TEH : Timing_Event_Handler;
   TS  : Time_Span;
begin
   Set_Handler (TE, TS, TEH);
end NoRelDel;

Generates the output:

noreldel.adb:10:04: violation of restriction "No_Relative_Delay" at line 1

Tested on x86_64-pc-linux-gnu, committed on trunk

2010-10-07  Robert Dewar  <dewar@adacore.com>

	* rtsfind.ads: Add entry for Ada.Real_Time.Timing_Events.Set_Handler
	* sem_res.adb (Resolve_Call): A call to
	Ada.Real_Time.Timing_Events.Set_Handler violates restriction
	No_Relative_Delay (AI-0211).

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]