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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,45a9122ddf5fcf5 X-Google-Attributes: gid103376,public From: dewar@schonberg.cs.nyu.edu (Robert Dewar) Subject: Re: Rules for Representation of Subtypes Date: 1996/09/28 Message-ID: #1/1 X-Deja-AN: 185843221 organization: New York University newsgroups: comp.lang.ada Date: 1996-09-28T00:00:00+00:00 List-Id: Bob Duff said "But this is all very obscure. If you're interfacing to hardware, or to C, or to something else where the interface is a low-level binary interface, the best thing to do is make the types match the hardware, or the C, or whatever it is. Don't use constraints on the Ada side of the interface, just because the logical properties would warrant a constraint. " If you are using GNAT, you need not worry about this. We found that so many users were depending on objects of a subtype being the same as objects of the base type that it was essential to do this. If you use a compiler that does NOT have this convention with existing Ada 83 code, our experience is that you will likely run into troubles. At the very least, I think that a compiler should regard a subtype object as having the same size as the base type for convention C. i.e. the implementatiojn advice in the RM to squeeze things down is actively undesirable for pragma foreign conventions where this would not be done by the foriegn language.