TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Mon, 17 Apr 2000 14:35:54 -0600
text/plain (29 lines)
I am trying to write a code generator for our project and the following
gets a compiler
error on both GNAT v3.12 and GreenHills v1.8.9.
type My_Array_Type is array( positive range <> ) of integer;
   A_const_array : constant My_Array_Type := ( 16#1234# );   --<<< line 407

while this does not get an error:

   A_const_array : constant My_Array_Type := ( 16#1234#,  16#1234# );

GHS output:

Error: line 407 col 4 LRM:8.6(28), Expression has no possible
interpretation as an expression of the expected type My_Array_Type,

I assume that because both compilers rejected the same statement that they
are correct, but why can't it interpret a single element array. The LRM
8.6(28) is not the most enlightening text :).

Robin P. Reagan - Software Engineer  [log in to unmask]
SEAKR Engineering, Inc.              v-303.649.1763x10
12847 East Peakview Avenue           f-303.649.1326
Englewood, CO  80011
"Imagination is more important than knowledge" -Albert Einstein-