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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4dd5c7301163bec5 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns14feed!worldnet.att.net!204.71.34.3!newsfeed.cwix.com!newsfeed.vmunix.org!peer-uk.news.demon.net!kibo.news.demon.net!mutlu.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Misaligned address error Date: Fri, 07 Sep 2007 22:49:26 +0100 Organization: Pushface Message-ID: References: <1189199157.591747.278390@r34g2000hsd.googlegroups.com> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1189201766 28239 62.49.19.209 (7 Sep 2007 21:49:26 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Fri, 7 Sep 2007 21:49:26 +0000 (UTC) Cancel-Lock: sha1:ljZXN7VGhPA6qMLKy1wo4PIPKoU= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (darwin) Xref: g2news2.google.com comp.lang.ada:1806 Date: 2007-09-07T22:49:26+01:00 List-Id: shaunpatterson@gmail.com writes: > i'm working with some really old legacy code that seemed to be > working fine with gnat pro 3.16a1. However, we decided to upgrade > to gnat 5. Not GNAT 6? > Everything built fine - however, I'm getting a misaligned address > value error at runtime: > > raised PROGRAM_ERROR : data_reader.2.ada:109 misaligned address > value > > Data_String : Data_Type_Array (1 .. 8) := (others => Data_Type > (Ascii.Nul)); > for Data_String'Alignment use 4; > Eight_Byte_Float : Long_Float_Type; > for Eight_Byte_Float'Address use Data_String'Address; --- FAILS ON > THIS LINE --- I would guess that Eight_Byte_Float'Alignment needs to be 8 on your machine? As I remember, a PowerPC has a maximum alignment requirement of 4, an x86 8. You could try saying for Data_String'Alignment use Long_Float_Type'Alignment; if the compiler will let you. Other than that, there is an attribute (possibly GNAT-special) which tells you the maximum alignment required by the processor.