comp.lang.ada
 help / color / mirror / Atom feed
From: "jimmaureenrogers@worldnet.att.net" <jimmaureenrogers@worldnet.att.net>
Subject: Re: problem with ada.interrupts
Date: 10 Aug 2005 11:19:37 -0700
Date: 2005-08-10T11:19:37-07:00	[thread overview]
Message-ID: <1123697977.213739.89920@g14g2000cwa.googlegroups.com> (raw)
In-Reply-To: 1123689689.517640.262600@z14g2000cwz.googlegroups.com

evangeli@cnam.fr wrote:
> hello
> in my program i want to catch the interruption by the user, e.g.,
> ctrl+c.
> i looked at the RM and it seems that package ada.interrupts is designed
> to do this kind of things.
> so i tested this little program (my compiler is gnat 3.15p) :
>

Consider the following statements from the Ada Reference Manual:

The form of a pragma Interrupt_Handler is as follows:

   pragma Interrupt_Handler(handler_name);

   The form of a pragma Attach_Handler is as follows:

   pragma Attach_Handler(handler_name, expression);

Name Resolution Rules

For the Interrupt_Handler and Attach_Handler pragmas, the handler_name
shall resolve to denote a protected procedure with a parameterless
profile.

For the Attach_Handler pragma, the expected type for the expression is
Interrupts.Interrupt_ID (see C.3.2).

Legality Rules

The Attach_Handler pragma is only allowed immediately within the
protected_definition where the corresponding subprogram is declared.
The corresponding protected_type_declaration or
single_protected_declaration shall be a library level declaration.

The Interrupt_Handler pragma is only allowed immediately within a
protected_definition. The corresponding protected_type_declaration
shall be a library level declaration. In addition, any
object_declaration of such a  type shall be a library level
declaration.

       -------

Your Attach_Handler pragma is misplaced.
You do not have an Interrupt_Handler pragma.

Your protected object is not defined at a library level.

Jim Rogers




  parent reply	other threads:[~2005-08-10 18:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-10 16:01 problem with ada.interrupts evangeli
2005-08-10 18:00 ` Robert A Duff
2005-08-10 18:19 ` jimmaureenrogers [this message]
2005-08-25 12:25 ` Thierry Pirot
replies disabled

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