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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!mx05.eternal-september.org!feeder.eternal-september.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Expected exception is not thrown in Windows XP, should be a compiler bug? Date: Mon, 27 May 2013 16:45:14 +0200 Organization: Tidorum Ltd Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: individual.net PuSSUyOlREVTmIWmKf03NADvWIaPULVwV5gc4tjTokWZIqiy7m Cancel-Lock: sha1:WZejBKUrNJiruVej6wLR5kOMjto= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 In-Reply-To: Xref: news.eternal-september.org comp.lang.ada:15654 Date: 2013-05-27T16:45:14+02:00 List-Id: On 13-05-27 12:10 , ake.ragnar.dahlgren@gmail.com wrote: > What follows are two code snippets that are nearly identical > but completely different behavior during runtime. > > Consider the following code: > > with Ada.Text_IO; > with Ada.Strings.Fixed; > with GNATCOLL.SQL.Postgres; [snip] > When compiled under Windows XP, Gnatcoll release 1.5w is > used and GNAT PRO is version .1.0w-20121028 based upon gcc > version 4.7.3 one gets the following output: > > C:\temp>main > > This application has requested the Runtime to terminate it in an unusual way. > Please contact the application's support team for more information. > > > Now consider the following code: > > with Ada.Text_IO; > with Ada.Strings.Fixed; > --with GNATCOLL.SQL.Postgres; [snip] > It has the expected output: > > C:\temp>main > Write some error message > > The only difference between the two applications is whether > the package GNATCOLL.SQL.Postgres is with:ed or not. It is not > even used and therefore should not have any impact on the > behavior of the application. If you "with" GNATCOLL.SQL.Postgres, that package (and packages that it depends on) are elaborated at run time, before your main procedure starts executing its statements. I don't know what sort of elaboration code those packages contain, but, in general, elaboration code can do anything that ordinary code can do, including making calls to operating system functions that may fail in some way, which perhaps causes the error message that you quoted. The reason for such failures may be something in the operating environment -- perhaps a missing environment variable, or a faulty value in an environment variable -- and is not *necessarily* a bug in the program or in the compiler. I would look into GNATCOLL.SQL.Postgres, or into its documentation (if any) to see if its elaboration code can cause the error, and under what circumstances. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .