discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDate oddity


From: David Relson
Subject: Re: NSDate oddity
Date: Fri, 04 May 2001 07:14:46 -0400

Richard,

Removing the 'volatile' typespec doesn't change the behavior nor does moving the initialization statement.

As I wrote to you last night, the problem happens in gdb the first time the first time that "interval += tp.tv_sec" is executed in function GSTimeNow(). In a multithreaded program, it occurs once per thread.

Attached are the following files:

prog.c - a C program including GSTimeNow(). The call to library function gettimeofday() has been replaced by an inline copy of the function because the problem doesn't occur at all times of day. The gcc command for building the executable is included in the program as a comment.

run.prog.out - the output of the program run at the command line showing correct results.

gdb-5.prog.out - the output of the program run under gdb-5 showing incorrect results.

gdb-4.prog.out - the output of the program using gdb-4.18-unoff-objc showing correct results.

The difference between gdb-4 and gdb-5 outputs demonstrates that gdb-5 is doing something special, causing the problem.

Guess the next step is to get the latest gdb snapshot and see what happens.

David


At 12:21 AM 5/4/01, Richard Frith-Macdonald wrote:

interval == NaN

That looks like a compiler problem ... it may be something to do with the variable being declared volatile (I don't know why it's declared that way, and don't think it should be).

Could you try

a. removing the 'volatile' typespec
b. moving the initialisation statement from before to after the gettimeofday()

_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
http://mail.gnu.org/mailman/listinfo/discuss-gnustep

Attachment: prog.c
Description: Text document

Attachment: run.prog.out
Description: Text document

Attachment: gdb-5.prog.out
Description: Text document

Attachment: gdb-4.prog.out
Description: Text document

--------------------------------------------------------
David Relson                   Osage Software Systems, Inc.
relson@osagesoftware.com       Ann Arbor, MI 48103
www.osagesoftware.com          tel:  734.821.8800

reply via email to

[Prev in Thread] Current Thread [Next in Thread]