comp.lang.ada
 help / color / mirror / Atom feed
From: "G.B." <bauhaus@futureapps.invalid>
Subject: Interrupt_Handler and "directly specified"
Date: Fri, 20 Nov 2015 19:33:52 +0100
Date: 2015-11-20T19:33:52+01:00	[thread overview]
Message-ID: <n2nou4$jap$1@dont-email.me> (raw)

For a protected handler, I had specified an aspect,

    procedure On_1
    with Interrupt_Handler => True;

and got a strange compiler diagnostic, listed below.

Is the above syntax correct?

I could drop " => True" and the compiler seemed happy. OTOH,
the RM states, in C.3.1 6.2/3, that "if not directly specified,
the aspect is False".

I don't know what "directly specified" in RM C.3.1 means,
exactly. Does it mean just specified as opposed to no
such aspect specified (in source, near it)? So drop "=> ..."
for truth?

The pragma version of Interrupt_Handler seems to support
this view in that it has only one argument, the procedure name.
But the mention of "False" in the RM lets me ask.

The example:

$ PATH=/opt/GNAT2015/bin:$PATH gcc -c -gnatlv -gnatwa parent.ads 
parent-admin.adb

GNAT GPL 2015 (20150428-49)
Copyright 1992-2015, Free Software Foundation, Inc.


Compiling: parent.ads
Source file time stamp: 2015-11-20 18:10:41
Compiled at: 2015-11-20 19:18:28

      1. package Parent is
      2. private
      3. end Parent;

  3 lines: No errors

GNAT GPL 2015 (20150428-49)
Copyright 1992-2015, Free Software Foundation, Inc.


Compiling: parent-admin.adb
Source file time stamp: 2015-11-20 18:18:17
Compiled at: 2015-11-20 19:18:28

      1.
      2. package body Parent.Admin is
      3.
      4.    protected body P1 is
      5.
      6.       procedure On_1
               |
         >>> expected type "System.Interrupts.Dynamic_Interrupt_Protection"
         >>> found private type 
"System.Tasking.Protected_Objects.Protection"

      7.       is begin
      8.          null;
      9.       end On_1;
     10.
     11.    end P1;
     12.
     13. end Parent.Admin;

Compiling: parent-admin.ads
Source file time stamp: 2015-11-20 18:18:10
Compiled at: 2015-11-20 19:18:28

      1.
      2. package Parent.Admin is
      3.
      4.    protected P1 is
      5.
      6.       procedure On_1
      7.       with Interrupt_Handler => True;
      8.
      9.    end P1;
     10.
     11. end Parent.Admin;

  13 lines: 2 errors


             reply	other threads:[~2015-11-20 18:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20 18:33 G.B. [this message]
2015-11-20 19:22 ` Interrupt_Handler and "directly specified" Simon Wright
2015-11-20 21:25 ` Randy Brukardt
2015-11-22  9:59   ` Georg Bauhaus
replies disabled

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