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-Thread: 103376,c4ab69bf7d3638f1,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder2.cambriumusenet.nl!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.78.MISMATCH!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Noel Duffy Newsgroups: comp.lang.ada Subject: Differences between gnat 4.4.5 and 4.5.1 Date: Thu, 10 Mar 2011 06:01:53 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 10 Mar 2011 06:01:53 +0000 (UTC) Injection-Info: mx01.eternal-september.org; posting-host="QxYkd7kDGfCTgFrRUmyyNw"; logging-data="22519"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/T6HcPd2/lWUXFgSzWfFkzcYsbc9lbKaI=" User-Agent: Pan/0.133 (House of Butterflies) Cancel-Lock: sha1:HAggJvEz0t4rZTulFJYk6q4VZW4= Xref: g2news2.google.com comp.lang.ada:18990 Date: 2011-03-10T06:01:53+00:00 List-Id: I recently started learning Ada using Fedora 14 and gcc-gnat 4.5.1 as my development environment and a copy of John Barne's book. I have another computer on which I installed Debian Squeeze and gcc-gnat-4.4.5. Both versions of gcc-gnat (I think it's gcc-gnat, the man pages describe it as GNU gnat) are the default versions from the distribution repositories. However, I noticed some differences in the generated executables created by these two compilers and I thought it worth investigating. The following (admittedly silly) program demonstrates the issue: -- with Ada.Strings.Wide_Unbounded; use Ada.Strings.Wide_Unbounded; with Ada.Text_IO; procedure Hello is N:Unbounded_Wide_String; begin Ada.Text_IO.Put_Line ("Hello World"); end Hello; -- I compile on both environments with this command: gnatmake -f -Os hello.adb -largs -s On Fedora 14, the generated program looks like this: $ ls -l hello -rwxrwxr-x. 1 noeld noeld 36352 Mar 10 18:08 hello On Debian, I see: $ ls -l hello -rwxr-xr-x 1 noeld noeld 13728 Mar 10 18:15 hello I only notice this disparity in size when my programs use unbounded strings. I develop using dynamic languages like PHP and Python to earn a living so I use unbounded strings in pretty much everything. I compiled some larger programs and the size disparity seems to remain relatively fixed. E.g, I have one program whose executable is 110k on Fedora but 83k on Debian. Both compilers produce dynamically linked executable programs. The programs all work equally well on both platforms. I wonder whether what I am seeing is a result of a difference in gcc-gnat version, a difference in distribution packaging, or possibly a combination of both. Is there anyone using Fedora here who could possibly shed any light on this? I must say that Ada development on Debian looks much nicer than Fedora: GPS is packaged along with GTK and POSIX bindings, and not forgetting the Ada standard in html.