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,ffdd4d59cbfb4caf X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Ada 95 Numerics questions for the experts Date: 1997/09/01 Message-ID: #1/1 X-Deja-AN: 269550392 References: Organization: New York University Newsgroups: comp.lang.ada Date: 1997-09-01T00:00:00+00:00 List-Id: Tuck said <> Tuck says "follow the recomendations" here where he means "follow the minimal requirements". There is a big difference. In this particular, case the RM recommendation is that the level of packing (for 3-bit components) result in a component size less than or equal to 4. GNAT chooses 3. Since 3 is (last time I looked) less than or equal to 4, GNAT is not "going beyond" the RM here, it is following the implementation advice of the RM (and this IA is in fact a requirement, given that GNAT supports Annex C). If Tuck had wasnted the RM to recommend that the component size should be exactly 4, he should have written this (although I am not sure others would have agreed it was a good choice, we have seem quite a bit of code that demands close packaing of 3-bit components (both VADS and Alsys at least, supported this feature). Yes, as Tuck says, if your primary concern is that code written for your compiler be easy to move to other compilers, then you implement the minimal lower bound. But if, as in the case of GNAT, your primary goal is to be inclusive, and correctly process code from other existing compilers providing a wide range of functionality that is permitted by the RM, but not required, or recommended against, then you implement the maximum. Note that GNAT whereever possible follows the advice in the RM even if it causes portability troubles. A common example is the following type arr8 is array (1..8) of boolean; for arr8'size use 8; The RM permits the size clause to cause implicit packing, but recommends against it. VADS at least permitted this implicit packing (even though there was an AI that recommended against it). Consequently in GNAT, we reject the above, and require an explicit pragma Pack. The workdaround for existing code here is easy, and the code is arguably clearer with the pragma there in any case. However, if you have code that depends on close packed 3 bit components, you are completely up the creak if your compiler does not support it!