* Possible Bug, Need Second Opinion
@ 2001-09-23 18:01 ANH_VO
2001-09-23 21:18 ` Florian Weimer
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: ANH_VO @ 2001-09-23 18:01 UTC (permalink / raw)
To: comp.lang.ada
I am nearly 100% certain that the codes below should compile fine. But, I would
like to have second opinion possibly more before reporting it.
with Interfaces;
package Global is
type Size_T is new Interfaces.Unsigned_32;
end Global;
with Global;
with Interfaces.C.Pointers;
package Index_Rejection is
use Global;
type Data_Array is array (Size_T range <>) of aliased Integer;
package Data_Pointers is
new Interfaces.C.Pointers
(Index => Size_T,
Element => Integer,
Element_Array => Data_Array,
Default_Terminator => 0);
end Index_Rejection;
However, when compiled using GNAT 3.13p on Windows 95, the compiler complains
with an error message of 'index_rejection.ads:14:32: index types of actual do
not match those of formal "Element_Array"'. On the other hand, if Size_T on
lines 8 and 12 is fully qualified as shown below, the compiler was happy.
with Global;
with Interfaces.C.Pointers;
package Index_Rejection is
use Global;
type Data_Array is array (Global.Size_T range <>) of aliased Integer;
package Data_Pointers is
new Interfaces.C.Pointers
(Index => Global.Size_T,
Element => Integer,
Element_Array => Data_Array,
Default_Terminator => 0);
end Index_Rejection;
Am I correct to conclude that there is a bug in the compiler?
Anh Vo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Possible Bug, Need Second Opinion
2001-09-23 18:01 Possible Bug, Need Second Opinion ANH_VO
@ 2001-09-23 21:18 ` Florian Weimer
2001-09-24 13:51 ` Ted Dennison
2001-09-25 18:51 ` Simon Wright
2 siblings, 0 replies; 4+ messages in thread
From: Florian Weimer @ 2001-09-23 21:18 UTC (permalink / raw)
ANH_VO@udlp.com writes:
> However, when compiled using GNAT 3.13p on Windows 95, the compiler
> complains with an error message of 'index_rejection.ads:14:32: index
> types of actual do not match those of formal "Element_Array"'.
Further experiments suggest that GNAT performs the name resolution for
generic actual parameters in the context of the generic, and not in
instantiating context. (Sorry, the terminology is probably
non-standard.)
I don't know if this is a property of the Ada language, but I would be
surprised if it was.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Possible Bug, Need Second Opinion
2001-09-23 18:01 Possible Bug, Need Second Opinion ANH_VO
2001-09-23 21:18 ` Florian Weimer
@ 2001-09-24 13:51 ` Ted Dennison
2001-09-25 18:51 ` Simon Wright
2 siblings, 0 replies; 4+ messages in thread
From: Ted Dennison @ 2001-09-24 13:51 UTC (permalink / raw)
In article <mailman.1001275761.28439.comp.lang.ada@ada.eu.org>, ANH_VO@udlp.com
says...
>
>I am nearly 100% certain that the codes below should compile fine. But, I would
>like to have second opinion possibly more before reporting it.
..
>not match those of formal "Element_Array"'. On the other hand, if Size_T on
>lines 8 and 12 is fully qualified as shown below, the compiler was happy.
Its tempting to term anything that encourages full qualification as a "feature".
:-)
---
T.E.D. homepage - http://www.telepath.com/dennison/Ted/TED.html
home email - mailto:dennison@telepath.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Possible Bug, Need Second Opinion
2001-09-23 18:01 Possible Bug, Need Second Opinion ANH_VO
2001-09-23 21:18 ` Florian Weimer
2001-09-24 13:51 ` Ted Dennison
@ 2001-09-25 18:51 ` Simon Wright
2 siblings, 0 replies; 4+ messages in thread
From: Simon Wright @ 2001-09-25 18:51 UTC (permalink / raw)
ANH_VO@udlp.com writes:
> I am nearly 100% certain that the codes below should compile
> fine. But, I would like to have second opinion possibly more before
> reporting it.
This compiles fine on GNAT 3.14a1.
-Simon
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2001-09-25 18:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-23 18:01 Possible Bug, Need Second Opinion ANH_VO
2001-09-23 21:18 ` Florian Weimer
2001-09-24 13:51 ` Ted Dennison
2001-09-25 18:51 ` Simon Wright
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox