comp.lang.ada
 help / color / mirror / Atom feed
* Expected exception is not thrown in Windows XP, should be a compiler bug?
@ 2013-05-27 10:10 ake.ragnar.dahlgren
  2013-05-27 14:45 ` Niklas Holsti
  2013-05-27 14:54 ` Jesper Quorning
  0 siblings, 2 replies; 5+ messages in thread
From: ake.ragnar.dahlgren @ 2013-05-27 10:10 UTC (permalink / raw)


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;

procedure Main is
   Host_URL      : aliased constant String := "localhosta";
begin
   declare
      type Host_URL_Type is new String (1 .. 9);

      Target_Host_URL      : Host_URL_Type;
   begin
         Ada.Strings.Fixed.Move (Source  => Host_URL,
                                 Target  => String (Target_Host_URL));
   end;
exception
   when others =>
      Ada.Text_IO.Put_Line("Write some error message");
end Main;

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.

C:\temp>





Now consider the following code:

with Ada.Text_IO;
with Ada.Strings.Fixed;
--with GNATCOLL.SQL.Postgres;

procedure Main is
   Host_URL      : aliased constant String := "localhosta";
begin
   declare
      type Host_URL_Type is new String (1 .. 9);

      Target_Host_URL      : Host_URL_Type;
   begin
         Ada.Strings.Fixed.Move (Source  => Host_URL,
                                 Target  => String (Target_Host_URL));
   end;
exception
   when others =>
      Ada.Text_IO.Put_Line("Write some error message");
end Main;

It has the expected output:

C:\temp>main
Write some error message

C:\temp>



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. I cannot detect this bug on my Mac OS X computer at home with GNAT Libre installed on it. Is there anybody else at comp.lang.ada that can detect this bug?

Best regards,
Åke Ragnar Dahlgren

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-05-28 16:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-27 10:10 Expected exception is not thrown in Windows XP, should be a compiler bug? ake.ragnar.dahlgren
2013-05-27 14:45 ` Niklas Holsti
2013-05-28 10:17   ` ake.ragnar.dahlgren
2013-05-28 16:46     ` Niklas Holsti
2013-05-27 14:54 ` Jesper Quorning

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox