From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e2a9ad4da0a64a87,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!a75g2000cwd.googlegroups.com!not-for-mail From: "Rolf" Newsgroups: comp.lang.ada Subject: Timing events in GNAT GPL 2006 Date: 12 Jan 2007 08:49:14 -0800 Organization: http://groups.google.com Message-ID: <1168620554.469932.313660@a75g2000cwd.googlegroups.com> NNTP-Posting-Host: 217.89.139.138 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1168620565 8292 127.0.0.1 (12 Jan 2007 16:49:25 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 12 Jan 2007 16:49:25 +0000 (UTC) User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 www-proxy-mozilla.vi.vector.int:8080 (squid/2.5.STABLE5), 1.0 vistrem1.vector-informatik.com:8080 (squid/2.5.STABLE12) Complaints-To: groups-abuse@google.com Injection-Info: a75g2000cwd.googlegroups.com; posting-host=217.89.139.138; posting-account=X6JcNAwAAACCYFUClJvh1OjD0lgttvkm Xref: g2news2.google.com comp.lang.ada:8120 Date: 2007-01-12T08:49:14-08:00 List-Id: I wanted to test the new Ada timing events with GNAT GPL 2006. Here is some code that should print a line every second. GNAT does not accept my protected procedure when setting the handler. Why? I don't see my error. Rolf -- with Ada.Real_Time; use Ada.Real_Time; with Ada.Real_Time.Timing_Events; use Ada.Real_Time.Timing_Events; with Ada.Text_IO; use Ada.Text_IO; procedure Test_Timing_Event is protected Clock_Tick is procedure Inc_Clock (Ev : Timing_Event); end Clock_Tick; Tick : Timing_Event; One_Sec : constant Time_Span := Seconds (1); protected body Clock_Tick is procedure Inc_Clock (Ev : Timing_Event) is begin Put_Line ("Inc_Sec"); -- using Time_Span Set_Handler (Tick, One_Sec, Handler => Inc_Clock'Access); end Inc_Clock; end Clock_Tick; begin -- using absolute time Set_Handler (Tick, Clock + One_Sec, Clock_Tick.Inc_Clock'Access); loop null; end loop; end Test_Timing_Event; $ gnatmake -gnat05 test_timing_event.adb gcc -c -gnat05 test_timing_event.adb test_timing_event.adb:20:10: no candidate interpretations match the actuals: test_timing_event.adb:20:29: expected private type "Ada.Real_Time.Time" test_timing_event.adb:20:29: found private type "Ada.Real_Time.Time_Span" test_timing_event.adb:20:29: ==> in call to "Set_Handler" at a-rttiev.ads:47 test_timing_event.adb:20:58: expected type "Ada.Real_Time.Timing_Events.Timing_Event_Handler" test_timing_event.adb:20:58: found type access to procedure "Inc_Clock" defined at line 20 test_timing_event.adb:20:58: ==> in call to "Set_Handler" at a-rttiev.ads:52 test_timing_event.adb:26:04: no candidate interpretations match the actuals: test_timing_event.adb:26:29: expected private type "Ada.Real_Time.Time_Span" test_timing_event.adb:26:29: found private type "Ada.Real_Time.Time" test_timing_event.adb:26:29: ==> in call to "Set_Handler" at a-rttiev.ads:52 test_timing_event.adb:26:60: expected type "Ada.Real_Time.Timing_Events.Timing_Event_Handler" test_timing_event.adb:26:60: found type access to procedure "Inc_Clock" defined at line 26 test_timing_event.adb:26:60: ==> in call to "Set_Handler" at a-rttiev.ads:47 gnatmake: "test_timing_event.adb" compilation error $ gnatls -v GNATLS GPL 2006 (20060522-34) Copyright 1997-2006, Free Software Foundation, Inc.