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, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,92882847c09de3aa,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-01-03 05:08:10 PST Path: nntp.gmd.de!newsserver.jvnc.net!news.cac.psu.edu!news.pop.psu.edu!hudson.lm.com!netline-fddi.jpl.nasa.gov!elroy.jpl.nasa.gov!lll-winken.llnl.gov!seismo!hal!hathor!jeffe From: jeffe@hathor.CSS.GOV (Jeff Etrick) Newsgroups: comp.lang.ada Subject: Language Lawyers help on rep_specs Keywords: Rep_Spec LRM Message-ID: <393@hathor.CSS.GOV> Date: 3 Jan 95 12:49:08 GMT Organization: ENSCO, Inc., Melbourne, FL Date: 1995-01-03T12:49:08+00:00 List-Id: Dear Language Lawyers, I have the following program which will compile and execute using one vendors Ada95 compiler and on another vendors Ada95 spits out LRM references. The LRM references are saying that my type Nuclear_Date_Times may not be used in a record represenation clause due to the fact it is not a simple static expression. Talking to the vendor about this issue I was told that the INTEGER conversion is a function and functions are not allowed in simple static expressions. Looking at 4.9(6) "a function_call whose function_name .........." tells me that static functions are allowed. My vendor insists that my program violates the LRM, could you please enlighten me on this. Which vendor is executing this program correctly? Thanks for the help, Jeff ------- with Text_IO; procedure test is -- This type is a subtype of pre-defined INTEGER, it is used -- for easy use of all pre-defined packages. -- This is a long integer range (4 bytes storage). subtype Full_Integer is INTEGER range -2**31..2**31 - 1; HOURS_IN_DAY : constant := 24; MINUTES_IN_HOUR : constant := 60; MINUTES_IN_DAY : constant := HOURS_IN_DAY * MINUTES_IN_HOUR; -- This type defines days from December 30, 1944 through December 31, 2099. type Dates is new Full_Integer range -1 .. 56_613; -- This is a single precision floating point range. -- This type uses the system defined FLOAT. subtype Single_Float is FLOAT digits 6; -- This type defines minutes, the range based upon the range -- declared in Dates. This represents number of minutes -- from the advent of the Nuclear age (1 JAN 1945, 00:00) type Nuclear_Date_Times is new Full_Integer range (INTEGER (Dates'first) - 1) * MINUTES_IN_DAY .. (INTEGER (Dates'last) * MINUTES_IN_DAY) - 1; type Header_Record_Type is record Date_Time : Full_Integer; --Nuclear_Date_Times; Id : Full_Integer; x : Full_Integer; y : Full_Integer; Latitude : Single_Float; Longitude : Single_Float; Elevation : Single_Float; Ltrs : STRING(1..4); end record; for Header_Record_Type use record at mod 4; Date_Time at 0 range 0..31; Id at 4 range 0..31; x at 8 range 0..31; y at 12 range 0..31; Latitude at 16 range 0..31; Longitude at 20 range 0..31; Elevation at 24 range 0..31; Ltrs at 28 range 0..31; end record; for Header_Record_Type'size use 32*8; begin Text_Io.Put_Line("Record Layout Test"); end test; --------------------------------------------------------------- Jeffery R. Etrick NET : jeffe@fisher.CSS.GOV ENSCO INC. MAIL : 445 Pineda Ct. Melbourne, Fl. 32940-7506 PHONE: 407-254-4122 ---------------------------------------------------------------