From: Georg Bauhaus on
On 3/6/10 1:06 PM, Simon Wright wrote:
> Georg Bauhaus<rm-host.bauhaus(a)maps.futureapps.de> writes:
>
>> On 3/6/10 12:35 AM, Simon Wright wrote:
>>> Alex Mentis<asmentis(a)gmail.com> writes:
>>>
>>>> Confirmed: the bug is still present in GNAT GPL 2009.
>>>
>>> Not on Mac OS X (Snow Leopard), it isn't.
>>
>> Seeing the different behavior, what should be the best update
>> for
>> http://en.wikibooks.org/wiki/Ada_Programming/Tips#Quirks
>
> That looks _quite_ explicit ("Using GNAT on Windows, ..."). It would be
> nice to have a reference to the (Bugzilla?) report!

Interesting in itself, and by coincidence, while reading
Pat Rogers's new contribution to the Shootout, I noticed
some lines that read

delay 0.0; -- yield

http://shootout.alioth.debian.org/u64q/program.php?test=chameneosredux&lang=gnat&id=2

From: Alex Mentis on
On Mar 6, 8:02 pm, Georg Bauhaus <rm-host.bauh...(a)maps.futureapps.de>
wrote:
> On 3/6/10 1:06 PM, Simon Wright wrote:
>
> > Georg Bauhaus<rm-host.bauh...(a)maps.futureapps.de>  writes:
>
> >> On 3/6/10 12:35 AM, Simon Wright wrote:
> >>> Alex Mentis<asmen...(a)gmail.com>   writes:
>
> >>>> Confirmed: the bug is still present in GNAT GPL 2009.
>
> >>> Not on Mac OS X (Snow Leopard), it isn't.
>
> >> Seeing the different behavior, what should be the best update
> >> for
> >>http://en.wikibooks.org/wiki/Ada_Programming/Tips#Quirks
>
> > That looks _quite_ explicit ("Using GNAT on Windows, ..."). It would be
> > nice to have a reference to the (Bugzilla?) report!
>
> Interesting in itself, and by coincidence, while reading
> Pat Rogers's new contribution to the Shootout, I noticed
> some lines that read
>
>    delay 0.0;  -- yield
>
> http://shootout.alioth.debian.org/u64q/program.php?test=chameneosredu....

Forward from AdaCore, FYI:

> We are able to reproduce the problem.

The problem is now understood and corrected in the development version
of GNAT.
It will most probably be corrected in GNAT GPL 2010.

What is happening here is that there is a missing call to
System.OS_Primitives.Initialize, when you use Ada.Real_Time but not
Ada.Calendar or any of the real time features of Ada, such as a delay
statement.

The fix consists in calling System.OS_Primitives.Initialize during
elaboration of Ada.Real_Time.

On POSIX platforms, because System.OS_Primitives.Initialize is a null
procedure, this missing call did not really matter.

Thank you for this report,

-- Vincent Celier