comp.lang.ada
 help / color / mirror / Atom feed
From: britt@molokai.46tg.af.mil (Capt. Britt Snodgrass)
Subject: Ada Portability... NOT!
Date: 18 Nov 1994 15:04:13 -0600
Date: 1994-11-18T15:04:13-06:00	[thread overview]
Message-ID: <199411182104.PAA04854@mail.cs.utexas.edu> (raw)

One recent post contained what I considered an overstatement of the
portability of Ada programs.  Let me describe my current problem and
hopefully many of you will provide some insight into the root cause.

I'm currently trying to port some avionics test data processing
software from an HP 9000/380 (HP-UX 8.00) to an HP-9000/735 (HP-UX
9.03).  The model 380 has a Motorola 68040 CPU while the model 735 has
a Hewlett-Packard PA-RISC CPU.  The code was orignially developed on the
model 380 using the VADS 6.0 Ada compiler.  The Ada compiler on the
model 735 is VADS 6.2.1(k).

All code compiled and executed correctly on the model 380.  I assumed
it would be a simple matter to copy all the source code to the model
735 and recompile it since I was still using the same vendors
compiler.  However, the following error messages came from the code
segment I've included at the end of this message.


ERROR MESSAGES:
*********************************  gps_io_.a  ***********************

 103:      Channel2 at   70 range 0..367;
A ---------^
A:error: Appendix F: component must be aligned on a 8 byte boundary
 104:      Channel3 at  116 range 0..367;
A ---------^
A:error: Appendix F: component must be aligned on a 8 byte boundary
 105:      Channel4 at  162 range 0..367;
A ---------^
A:error: Appendix F: component must be aligned on a 8 byte boundary
m
********************************************************************

QUESTION 1: What have I done wrong, if anything?  I'm familiar with
the Ada Style Guide and its cautions on the use of representation
clauses.  We feel these representation clauses are necessary to make
our data records match the packed binary data we read from disk files.

QUESTION 2: Do RISC processors actually require such strict (8 byte
boundary) alignment constraints?  VADS 6.2 for Windows NT on an Intel
i486 processor (non-RISC) enforces the same constraint but maybe
because Windows NT is also available for RISC processors.  Do the
creators of GNAT have any insight on this?  (Rational tech support
couldn't answer it).



CODE:
-------------------------------------------------------------------
   type ICD_IRG_010_Channel_Type is record
      ChID              : Short_Int;  -- 2 bytes
      PRN               : Short_Int;  -- 2 bytes
      Frequency         : Short_Int;  -- 2 bytes
      Code              : Short_Int;  -- 2 bytes
      TrackingState     : Short_Int;  -- 2 bytes
      CarToNo           : Short_Int;  -- 2 bytes
      RCVRMeasValid     : Short_Int;  -- 2 bytes
      PseudoRangeMeas   : Real;       -- 8 bytes
      DeltaRangeMeas    : Real;       -- 8 bytes
      dtDeltaRange      : Real;       -- 8 bytes
      Spare             : Real;       -- 8 bytes
   end record;

   for ICD_IRG_010_Channel_Type use record at mod 8;
      ChID            at  0 range 0..15;
      PRN             at  2 range 0..15;
      Frequency       at  4 range 0..15;
      Code            at  6 range 0..15;
      TrackingState   at  8 range 0..15;
      CarToNo         at 10 range 0..15;
      RCVRMeasValid   at 12 range 0..15;
      PseudoRangeMeas at 14 range 0..63;
      DeltaRangeMeas  at 22 range 0..63;
      dtDeltaRange    at 30 range 0..63;
      Spare           at 38 range 0..63;
   end record;

   for ICD_IRG_010_Channel_Type'size use 8 * 46;  -- 46 bytes

   type ICD_IRG_010_Corrected_Input_Type is record
      tBlock   : Real;
      tMeasU20 : Real;
      tOffsetU : Real;
      Channel1 : ICD_IRG_010_Channel_Type;
      Channel2 : ICD_IRG_010_Channel_Type;
      Channel3 : ICD_IRG_010_Channel_Type;
      Channel4 : ICD_IRG_010_Channel_Type;
      Channel5 : ICD_IRG_010_Channel_Type;
   end record;

   for ICD_IRG_010_Corrected_Input_Type use
      record at mod 8;
      tBlock   at    0 range 0..63;
      tMeasU20 at    8 range 0..63;
      tOffsetU at   16 range 0..63;
      Channel1 at   24 range 0..367;
      Channel2 at   70 range 0..367;                    -- line 103
      Channel3 at  116 range 0..367;                    -- line 104
      Channel4 at  162 range 0..367;                    -- line 105
      Channel5 at  208 range 0..367;
   end record;

   for ICD_IRG_010_Corrected_Input_Type'size use 254 * 8;

   type ICD_IRG_010_Channel_Array_Type is
      array(Short_Int range 1..5) of ICD_IRG_010_Channel_Type;


================================================================
Capt Britt Snodgrass           e-mail: britt@molokai.46tg.af.mil
                               member: Team Ada & Team OS/2
================================================================





             reply	other threads:[~1994-11-18 21:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-11-18 21:04 Capt. Britt Snodgrass [this message]
1994-11-19 16:55 ` Ada Portability... NOT! Robert Dewar
1994-11-21  2:11   ` Carlos Perez
1994-11-21 13:17     ` Robert Dewar
1994-11-21 23:56   ` Keith Thompson
1994-11-22  3:53     ` Robert Dewar
1994-11-23 12:49     ` Michael J. Meier
1994-11-24 19:21       ` R_Tim_Coslet
1994-11-20  1:33 ` Carlos Perez
1994-11-21  5:06 ` Niklas Holsti
1994-11-21 16:19   ` Norman H. Cohen
1994-11-21 14:59 ` Mitch Gart
1994-11-21 15:40 ` Michael J. Meier
replies disabled

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