comp.lang.ada
 help / color / mirror / Atom feed
* Misaligned address error
@ 2007-09-07 21:05 shaunpatterson
  2007-09-07 21:41 ` Adam Beneschan
  2007-09-07 21:49 ` Simon Wright
  0 siblings, 2 replies; 4+ messages in thread
From: shaunpatterson @ 2007-09-07 21:05 UTC (permalink / raw)


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.

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

The code:

  subtype Data_Type is Character;

  type Data_Type_Array is array (Natural range <>) of Data_Type;

  Data_String : Data_Type_Array (1 .. 8) := (others => Data_Type
(Ascii.Nul));
  for Data_String'Alignment use 4;
  for Data_String'Size use 8 * Data_Type'Size;
  -- global data buffer for reading and writing to file

  -- quick conversion variables
  One_Byte_Number : One_Byte_Number_Type;
  for One_Byte_Number'Address use Data_String'Address;

  Two_Byte_Number : Two_Byte_Number_Type;
  for Two_Byte_Number'Address use Data_String'Address;

  Four_Byte_Number : Four_Byte_Number_Type;
  for Four_Byte_Number'Address use Data_String'Address;

  Four_Byte_Signed_Number : Four_Byte_Signed_Number_Type;
  for Four_Byte_Signed_Number'Address use Data_String'Address;

  Four_Byte_Float : Float_Type;
  for Four_Byte_Float'Address use Data_String'Address;

  Eight_Byte_Float : Long_Float_Type;
  for Eight_Byte_Float'Address use Data_String'Address;  --- FAILS ON
THIS LINE ---


Could anyone help me make sense of this exception?

thanks
--
Shaun




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

end of thread, other threads:[~2007-09-07 22:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-07 21:05 Misaligned address error shaunpatterson
2007-09-07 21:41 ` Adam Beneschan
2007-09-07 21:49 ` Simon Wright
2007-09-07 22:52   ` Simon Wright

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