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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,56452c8eb57ca531,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-09-03 05:08:22 PST Path: supernews.google.com!sn-xit-02!sn-east!supernews.com!news-feed.riddles.org.uk!nntp.cs.ubc.ca!skynet.be!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!do.de.uu.net!nr-do2.de.uu.net!personalnews.de.uu.net!not-for-mail From: andrew.lynch@knuut.de (Andrew Lynch) Subject: Problem porting VADS to GNAT Newsgroups: comp.lang.ada Organization: Blob Reply-To: andrew.lynch@knuut.de Summary: X-Newsreader: TIN [version 1.2 PL2] Date: 03 Sep 2000 12:06:31 GMT Message-ID: <39b23ec7$0$29240@personalnews.de.uu.net> NNTP-Posting-Host: 149.225.147.66 X-Trace: personalnews.de.uu.net 967982791 29240 149.225.147.66 Xref: supernews.google.com comp.lang.ada:486 Date: 2000-09-03T12:06:31+00:00 List-Id: One of the guys I am working with at a client complained that "the compilers on your CD-ROM are crap!" (he was referring to the CCI Ada-Tour, which contains (old) versions of GNAT and Object-Ada). This started off a discussion about how portable Ada is etc... For the project we are using the VADS Ada Compiler Version 6.2.3(c) for SPARC Solaris 2.3 together with some in-house tools that generate Ada code from various templates and data definitions. My colleague's task is to write another code generator with different inputs, but this uses packages generated by the old tools. He would like to be able to syntax check the code generated by his tool at home using GNAT before making new versions of his generator available. Problem 1: The existing packages contain hundreds of types and representation clauses as in the following example: ---------- package foo is type numbers is (one, two, three); type bummer(bar : numbers := one) is record case bar is when one => eins : integer; when two => zwei : integer; when three => drei : integer; end case; end record; -- loads of other types private for numbers'Size use 32; for numbers use ( one => 0, two => 1, three => 2); -- similiar clauses for bummer and all the other types... -- (in the same order as the public declarations) end foo; ---------- GNAT has these complaints about the code, always regarding the discriminants of variant record types: foo.ads:5:08: warning: no more representation items for type "numbers" defined at line 3 foo.ads:19:03: representation item appears too late foo.ads:20:03: representation item appears too late My colleague is using GNAT 3.10p, I tried this example using GNAT 3.13a with the same results. VADS compiles it just fine. Is this an Ada83 - Ada95 issue, or is GNAT being too strict or VADS too lenient? I've tried comparing the relevant sections of the 83 and 95 LRMs but haven't come up with anything obvious. Also, what effect (if any) is achieved by moving the representation clauses into the private part? The only thing I can think of is as documentation for the user: "The representations are none of your business". Andrew. -- Andrew Lynch CCI GmbH 49716 Meppen lynch@cci.de