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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,967a201c4428b348 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-02 17:53:45 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Enumeration representation Date: 02 Jan 2004 20:53:45 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <3FF57910.60406@noplace.com> NNTP-Posting-Host: pip1-5.std.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1073094825 4399 192.74.137.185 (3 Jan 2004 01:53:45 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sat, 3 Jan 2004 01:53:45 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:4057 Date: 2004-01-02T20:53:45-05:00 List-Id: Marin David Condic writes: >...I wonder if it causes any harm by way of > inefficiency in some respect? IMHO, it *should* not cause harm (to efficiency) to say "for Enum use (0,1,2);". The compiler's logic *should* be, "if the representation, whether chosen by the user, or chosen by default, is the normal efficient one, then generate efficient code". However, I have seen compilers that think, "if the representation is chosen by the user, then generate all kinds of lookup tables, otherwise do the efficient thing". That's bad, because if the user asks for exactly what the compiler would have chosen by default, you get different and less efficient code. - Bob