From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC,XPRIO autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,99bdd3ab705f1a6a,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-04 23:14:00 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!luth.se!erix.ericsson.se!erinews.ericsson.se!newstoo.ericsson.se!not-for-mail From: "Sebastian" Newsgroups: comp.lang.ada Subject: Pragma Import on arrays in record types Date: Tue, 5 Nov 2002 08:13:39 +0100 Organization: ericsson Message-ID: Reply-To: "Sebastian" NNTP-Posting-Host: 172.17.82.166 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Xref: archiver1.google.com comp.lang.ada:30373 Date: 2002-11-05T08:13:39+01:00 List-Id: Hi, Why do I get a compiler warning when I do an overlaid storage of a record type consisting of an array? See below. When I use pragma Import on the object it works fine but what is the compiler doing? /S with Interfaces; use Interfaces; with Ada.Text_Io; use Ada.Text_Io; procedure Array_Test is type Flag_Type is (Reset, Set); for Flag_Type'Size use 1; ------------------------------------------------------------------------ package Enum is new ada.text_io.enumeration_Io(Flag_Type); use Enum; ------------------------------------------------------------------------ type Index_Type is ( Index_0, Index_1, Index_2, Index_3, Index_4, Index_5, Index_6, Index_7, Index_8, Index_9, Index_10, Index_11, Index_12, Index_13, Index_14, Index_15); for Index_Type'Size use 16; type Array_Of_Index_Type is array (Index_Type) of Flag_Type; pragma pack(Array_Of_Index_Type); ------------------------------------------------------------------------ type Record_Type is record Gp_Flag_Command : Array_Of_Index_Type; end record; for Record_Type use record Gp_Flag_Command at 0 range 0 ..15; end record; pragma Volatile(Record_Type); ------------------------------------------------------------------------ Record_1 : Record_Type; Record_2 : Record_Type; -- pragma import(Ada, Device_2); for Record_2'Address use Record_1'Address; begin null; end Array_Test;