comp.lang.ada
 help / color / mirror / Atom feed
* A Text_IO fixes it?
@ 1999-12-20  0:00 canada_bass
  1999-12-21  0:00 ` Matthew Heaney
  1999-12-21  0:00 ` Pascal Obry
  0 siblings, 2 replies; 7+ messages in thread
From: canada_bass @ 1999-12-20  0:00 UTC (permalink / raw)


I've been having a problem with accessing an
array of records. This array is declared in the
package body and is never changed inside the
package (not a constant but should be). When I
try to read one fields of a record (which is an
enumerated from another package) I get the
incorrect data(consistently).

Now, here is where I got confused. I can do a
Text_IO.Put_Line (with a 'Image) of the data that
I am trying to access and it will display the
wrong value, BUT the statements following the
Put_Line will work correctly. So I figure that I
would put the same Put_Line two times in a row.
The first time it displays the incorrect data and
the second time it displays the correct data! \
This is without any other procedures calling this
one or manipulating the variable that is passed
to this procedure(the index of the array).

I've tested various ideas but I still can't seem
to come up with a solution. Has anyone ever
encountered such a thing?


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: A Text_IO fixes it?
  1999-12-20  0:00 A Text_IO fixes it? canada_bass
@ 1999-12-21  0:00 ` Matthew Heaney
  1999-12-21  0:00 ` Pascal Obry
  1 sibling, 0 replies; 7+ messages in thread
From: Matthew Heaney @ 1999-12-21  0:00 UTC (permalink / raw)


In article <83m49f$f9j$1@nnrp1.deja.com> , canada_bass@my-deja.com  
wrote:

> I've been having a problem with accessing an
> array of records. This array is declared in the
> package body and is never changed inside the
> package (not a constant but should be). When I
> try to read one fields of a record (which is an
> enumerated from another package) I get the
> incorrect data(consistently).

Post the smallest fragment of code that has the problem.  Without code,
we can't help you.





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

* Re: A Text_IO fixes it?
  1999-12-20  0:00 A Text_IO fixes it? canada_bass
  1999-12-21  0:00 ` Matthew Heaney
@ 1999-12-21  0:00 ` Pascal Obry
  1999-12-21  0:00   ` C Bass
  1999-12-22  0:00   ` C Bass
  1 sibling, 2 replies; 7+ messages in thread
From: Pascal Obry @ 1999-12-21  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1054 bytes --]


<canada_bass@my-deja.com> a �crit dans le message :
83m49f$f9j$1@nnrp1.deja.com...

<bug description deleted>

Fine, this looks like a compiler bug but you did not tell us which compiler
you use, on which platform with what option do you compile your package...

Pascal.

--

--|------------------------------------------------------------
--| Pascal Obry                               Team-Ada Member |
--|                                                           |
--| EDF-DER-IPN-SID- T T I                                    |
--|                       Intranet: http://cln46gb            |
--| Bureau N-023            e-mail: pascal.obry@edf.fr        |
--| 1 Av G�n�ral de Gaulle  voice : +33-1-47.65.50.91         |
--| 92141 Clamart CEDEX     fax   : +33-1-47.65.50.07         |
--| FRANCE                                                    |
--|------------------------------------------------------------
--|
--|   http://ourworld.compuserve.com/homepages/pascal_obry
--|
--|   "The best way to travel is by means of imagination"







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

* Re: A Text_IO fixes it?
  1999-12-21  0:00 ` Pascal Obry
@ 1999-12-21  0:00   ` C Bass
  1999-12-22  0:00   ` C Bass
  1 sibling, 0 replies; 7+ messages in thread
From: C Bass @ 1999-12-21  0:00 UTC (permalink / raw)


You are quite right, my fault. I had thought I had included in a prior
paragragh, but must have mistakenly deleted it.

Solaris 2.5
Sparcworks Compiler Ada 2.1.1
This particular portion is called from a task that monitors selections of
buttons.

Canada






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

* Re: A Text_IO fixes it?
  1999-12-22  0:00   ` C Bass
@ 1999-12-22  0:00     ` Robert A Duff
  1999-12-27  0:00       ` C Bass
  0 siblings, 1 reply; 7+ messages in thread
From: Robert A Duff @ 1999-12-22  0:00 UTC (permalink / raw)


"C Bass" <cmbass@mindspring.com> writes:

> You were right, it was the compiler. I had no set the optimization level and
> it was using the default ptimization level for the compiler. I turned off
> optimization and everything seemed to be working just fine. It actually
> fixed quite a many error we have found.

If turning off optimization changes the program's behavior, that does
not *necessarily* mean there's an optimizer bug, as you seem to imply.
It could also be that your program does something erroneous
(unpredictable), and it happened to do some damage when optimized, but
it happened to work when not optimized.

If you have a small test case, it might be interesting to see it...

- Bob




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

* Re: A Text_IO fixes it?
  1999-12-21  0:00 ` Pascal Obry
  1999-12-21  0:00   ` C Bass
@ 1999-12-22  0:00   ` C Bass
  1999-12-22  0:00     ` Robert A Duff
  1 sibling, 1 reply; 7+ messages in thread
From: C Bass @ 1999-12-22  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1465 bytes --]

You were right, it was the compiler. I had no set the optimization level and
it was using the default ptimization level for the compiler. I turned off
optimization and everything seemed to be working just fine. It actually
fixed quite a many error we have found.

Canada

"Pascal Obry" <p.obry@der.edf.fr> wrote in message
news:83nc6p$hm7$1@clnews.edf.fr...
>
> <canada_bass@my-deja.com> a �crit dans le message :
> 83m49f$f9j$1@nnrp1.deja.com...
>
> <bug description deleted>
>
> Fine, this looks like a compiler bug but you did not tell us which
compiler
> you use, on which platform with what option do you compile your package...
>
> Pascal.
>
> --
>
> --|------------------------------------------------------------
> --| Pascal Obry                               Team-Ada Member |
> --|                                                           |
> --| EDF-DER-IPN-SID- T T I                                    |
> --|                       Intranet: http://cln46gb            |
> --| Bureau N-023            e-mail: pascal.obry@edf.fr        |
> --| 1 Av G�n�ral de Gaulle  voice : +33-1-47.65.50.91         |
> --| 92141 Clamart CEDEX     fax   : +33-1-47.65.50.07         |
> --| FRANCE                                                    |
> --|------------------------------------------------------------
> --|
> --|   http://ourworld.compuserve.com/homepages/pascal_obry
> --|
> --|   "The best way to travel is by means of imagination"
>
>
>






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

* Re: A Text_IO fixes it?
  1999-12-22  0:00     ` Robert A Duff
@ 1999-12-27  0:00       ` C Bass
  0 siblings, 0 replies; 7+ messages in thread
From: C Bass @ 1999-12-27  0:00 UTC (permalink / raw)


You are probably right. Unfortunately, it is hard to minimize what all it
fixed in the 120k+ lines of code we have for this program. It may have been
the optimization for the GUI code (that seemed to be causing the problems).

The *real* problem is that I am about to leave this job for another and
no-one else there has the knowledge to do what I had intended to do
(re-write the GUI). We have one package that creates all the widgets used,
but that one file is 20,000+ lines long. This is really unnecessary as most
of the code can be written into reusable procedures. But as I said, I am
leaving (soon) and don't have the time to rewrite it. :(

Canada

"Robert A Duff" <bobduff@world.std.com> wrote in message
news:wcc7li6de0f.fsf@world.std.com...
> "C Bass" <cmbass@mindspring.com> writes:
>
> > You were right, it was the compiler. I had no set the optimization level
and
> > it was using the default ptimization level for the compiler. I turned
off
> > optimization and everything seemed to be working just fine. It actually
> > fixed quite a many error we have found.
>
> If turning off optimization changes the program's behavior, that does
> not *necessarily* mean there's an optimizer bug, as you seem to imply.
> It could also be that your program does something erroneous
> (unpredictable), and it happened to do some damage when optimized, but
> it happened to work when not optimized.
>
> If you have a small test case, it might be interesting to see it...
>
> - Bob






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

end of thread, other threads:[~1999-12-27  0:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-20  0:00 A Text_IO fixes it? canada_bass
1999-12-21  0:00 ` Matthew Heaney
1999-12-21  0:00 ` Pascal Obry
1999-12-21  0:00   ` C Bass
1999-12-22  0:00   ` C Bass
1999-12-22  0:00     ` Robert A Duff
1999-12-27  0:00       ` C Bass

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