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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c70bb16b3813e0fd,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-11-18 17:26:16 PST Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!cs.utexas.edu!not-for-mail From: britt@molokai.46tg.af.mil (Capt. Britt Snodgrass) Newsgroups: comp.lang.ada Subject: Ada Portability... NOT! Date: 18 Nov 1994 15:04:13 -0600 Organization: UTexas Mail-to-News Gateway Sender: nobody@cs.utexas.edu Message-ID: <199411182104.PAA04854@mail.cs.utexas.edu> NNTP-Posting-Host: news.cs.utexas.edu Date: 1994-11-18T15:04:13-06:00 List-Id: 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 ================================================================