comp.lang.ada
 help / color / mirror / Atom feed
* Error with:   for EntryName use at 16#address#;
@ 2001-11-25  2:14 Jean-David Tr�panier
  2001-11-25  9:01 ` Jerry van Dijk
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Jean-David Tr�panier @ 2001-11-25  2:14 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 843 bytes --]

Hi! I have a little problem for handling an interrupt. I receive this error
at the compilation of the code below:  Expression has no possible
interpretation as an expression of the expected type Address, Continuing



   with Text_IO; with System;
   procedure main is
--------TASK-----------
     task TKeyboard is
         entry keyp;
         for Keyp use at 16#20#;       -- Error at this line
     end TKeyboard;

     task body TKeyboard is
     begin
         loop
         accept keyp do
               text_io.put_line("Keypressed (numlock)");
         end keyp;
         end loop;
    end TKeyboard;
------END TASK---------

 begin
      ...
 end main;

Is it a good way to handle interrupt or it's preferable to use
Attach_Handler(Handler, Int_ID) in the interrupt package.

Thanks,

Jean-David Tr�panier
(JDT@hy.cgocable.ca)





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Error with:   for EntryName use at 16#address#;
  2001-11-25  2:14 Error with: for EntryName use at 16#address#; Jean-David Tr�panier
@ 2001-11-25  9:01 ` Jerry van Dijk
  2001-11-26  2:58 ` Nick Roberts
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Jerry van Dijk @ 2001-11-25  9:01 UTC (permalink / raw)


"Jean-David Tr�panier" <JDT@hy.cgocable.ca> writes:

> Hi! I have a little problem for handling an interrupt. I receive this error
> at the compilation of the code below:  Expression has no possible
> interpretation as an expression of the expected type Address, Continuing

>      task TKeyboard is
>          entry keyp;
>          for Keyp use at 16#20#;       -- Error at this line
>      end TKeyboard;

I'm affaid that the compiler is right here. Thing for a moment what
your were trying to tell it.

> Is it a good way to handle interrupt or it's preferable to use
> Attach_Handler(Handler, Int_ID) in the interrupt package.

That depends on the OS or bareboard your are using.

-- 
--  Jerry van Dijk   | email: jvandyk@attglobal.net
--  Leiden, Holland  | web:   home.trouwweb.nl/Jerry



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Error with:   for EntryName use at 16#address#;
  2001-11-25  2:14 Error with: for EntryName use at 16#address#; Jean-David Tr�panier
  2001-11-25  9:01 ` Jerry van Dijk
@ 2001-11-26  2:58 ` Nick Roberts
  2001-11-27  4:04 ` Robert Dewar
  2001-11-27 14:02 ` Stephen Leake
  3 siblings, 0 replies; 7+ messages in thread
From: Nick Roberts @ 2001-11-26  2:58 UTC (permalink / raw)


At least three questions:

(1) What hardware is your host & target, precisely?

(2) What OS/RTS (& version) runs on your host & target?

(3) Which Ada compiler are you using (and what version)?

You must answer at least these questions before we can help you. There is
another:

(4) What, overall, are you trying to do?

I wish to help as much as I can!

--
Best wishes,
Nick Roberts







^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Error with:   for EntryName use at 16#address#;
  2001-11-25  2:14 Error with: for EntryName use at 16#address#; Jean-David Tr�panier
  2001-11-25  9:01 ` Jerry van Dijk
  2001-11-26  2:58 ` Nick Roberts
@ 2001-11-27  4:04 ` Robert Dewar
  2001-11-27 14:02 ` Stephen Leake
  3 siblings, 0 replies; 7+ messages in thread
From: Robert Dewar @ 2001-11-27  4:04 UTC (permalink / raw)


"Jean-David Tr?anier" <JDT@hy.cgocable.ca> wrote in message news:<SwYL7.8837$qw1.2054447@weber.videotron.net>...
>          for Keyp use at 16#20#;       -- Error at this 
>                                                   line

Generally this kind of question is best addressed to your
compiler vendor, since this kind of issue is quite compiler
dependent. However, it seems worth pointing out that any
compiler that follows implementation advice (RM 13.7)


37   Address should be of a private type.

will of course reject this declaration. It is surprising
if any Ada 95 compiler does NOT follow this (very good)
implementation advice.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Error with:   for EntryName use at 16#address#;
  2001-11-25  2:14 Error with: for EntryName use at 16#address#; Jean-David Tr�panier
                   ` (2 preceding siblings ...)
  2001-11-27  4:04 ` Robert Dewar
@ 2001-11-27 14:02 ` Stephen Leake
  2001-11-27 19:26   ` Louis Granger
  3 siblings, 1 reply; 7+ messages in thread
From: Stephen Leake @ 2001-11-27 14:02 UTC (permalink / raw)


"Jean-David Tr�panier" <JDT@hy.cgocable.ca> writes:

> Hi! I have a little problem for handling an interrupt. I receive this error
> at the compilation of the code below:  Expression has no possible
> interpretation as an expression of the expected type Address, Continuing
> 
> 
> 
>    with Text_IO; with System;
>    procedure main is
> --------TASK-----------
>      task TKeyboard is
>          entry keyp;
>          for Keyp use at 16#20#;       -- Error at this line

This looks like a copy from an Ada 83 compiler, where the "address"
for an entry was typically an interrupt number. In Ada 95, things are
different. You need to read your compiler manual.

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Error with:   for EntryName use at 16#address#;
  2001-11-27 14:02 ` Stephen Leake
@ 2001-11-27 19:26   ` Louis Granger
  2001-11-27 20:41     ` Jerry van Dijk
  0 siblings, 1 reply; 7+ messages in thread
From: Louis Granger @ 2001-11-27 19:26 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 837 bytes --]


Why don't you try this one. It compiles without any error with GNAT 3.13p under
W2K.

....Louis

Stephen Leake a ?crit :

> "Jean-David Tr?panier" ?JDT@hy.cgocable.ca? writes:
>
> ? Hi! I have a little problem for handling an interrupt. I receive this error
> ? at the compilation of the code below:  Expression has no possible
> ? interpretation as an expression of the expected type Address, Continuing
> ?
> ?
> ?
> ?    with Text_IO; with System;
> ?    procedure main is
> ? --------TASK-----------
> ?      task TKeyboard is
> ?          entry keyp;
> ?          for Keyp use at 16#20#;       -- Error at this line
>
> This looks like a copy from an Ada 83 compiler, where the "address"
> for an entry was typically an interrupt number. In Ada 95, things are
> different. You need to read your compiler manual.
>
> --
> -- Stephe

[-- Attachment #2: main.txt --]
[-- Type: text/plain, Size: 528 bytes --]

   with Text_IO; with System;
   with System.Storage_Elements;
   procedure main is
   --------TASK-----------
      task TKeyboard is
         entry keyp;
         for Keyp'Address use System.Storage_Elements.To_Address (16#20#);    
      end TKeyboard;
   
      task body TKeyboard is
      begin
         loop
            accept keyp do
               text_io.put_line("Keypressed (numlock)");
            end keyp;
         end loop;
      end TKeyboard;
   ------END TASK---------
   
   begin
      null;
   end main;



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Error with:   for EntryName use at 16#address#;
  2001-11-27 19:26   ` Louis Granger
@ 2001-11-27 20:41     ` Jerry van Dijk
  0 siblings, 0 replies; 7+ messages in thread
From: Jerry van Dijk @ 2001-11-27 20:41 UTC (permalink / raw)



Louis Granger <louis.granger@courriel.polymtl.ca> writes:

> Why don't you try this one. It compiles without any error with GNAT 3.13p under
> W2K.

[snip]

>    with Text_IO; with System;
>    with System.Storage_Elements;
>    procedure main is
>    --------TASK-----------
>       task TKeyboard is
>          entry keyp;
>          for Keyp'Address use System.Storage_Elements.To_Address (16#20#);    
>       end TKeyboard;
>    
>       task body TKeyboard is
>       begin
>          loop
>             accept keyp do
>                text_io.put_line("Keypressed (numlock)");
>             end keyp;
>          end loop;
>       end TKeyboard;
>    ------END TASK---------
>    
>    begin
>       null;
>    end main;

Here it results, as expected, in a program error, since there is no
signal 32 in Win32. Maybe you are using the DOS compiler ?

-- 
--  Jerry van Dijk   | email: jvandyk@attglobal.net
--  Leiden, Holland  | web:   home.trouwweb.nl/Jerry



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-11-27 20:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-25  2:14 Error with: for EntryName use at 16#address#; Jean-David Tr�panier
2001-11-25  9:01 ` Jerry van Dijk
2001-11-26  2:58 ` Nick Roberts
2001-11-27  4:04 ` Robert Dewar
2001-11-27 14:02 ` Stephen Leake
2001-11-27 19:26   ` Louis Granger
2001-11-27 20:41     ` Jerry van Dijk

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