1 Jul 2004 08:07
problem with writeln (or program bug?)
<Mingeborg <at> aol.com>
2004-07-01 06:07:10 GMT
2004-07-01 06:07:10 GMT
Enclosed is a gzipped tar file containing program ind.p (298 lines.)
As is, the program goes into infinite recursion, but it works correctly if you comment out a “writeln”
statement on line 248, (the statement before ***************...)
(gpc-20040516, Linux running on a Pentium 4 laptop.)
I apologize for the size of the example, but I have been unable to reproduce the problem with a smaller
example, and I don't understand what is happening.
The following are lines 238 – 249 of the program.
...
function rcrsv_ind_st2(var g:relation; s:subset): subset;
{this one is not debugged yet. gives different result than rcrs2 for the
third fullerene}
var i,k,l,k1,k2 :integer;
nb,ind1,ind2 :subset;
iterations :integer=0; attribute (static);
begin
{writeln('top:'); diagnose_subset(s); stop_n_go;}
iterations := iterations+1;
writeln('iteration number:',iterations); {************ comment this out, and it works ********}
if not there_are_edges_in(s,g)
...
This particular code works correctly on DIGITAL Pascal, (after changing the syntax for the static
variable declaration,) but “writeln” statements in “wrong” (but different) places have the
same effect there, also.
The program is hardwired to compute the largest independent set of a path with 2 vertices, and the output
(Continue reading)
> Although gcc-3.2.1 was already installed on the system, building
> with it didn't seem to work (unrecognizable insn). So I did this ...
Interesting. With gcc-3.3.1, *these* problems didn't happen for me.
[..]
> > The effect is quite different here. It builds all of xgpc and the
> > libgpc.a just fine, but then crashes in trying to build "binobj".
>
> (BTW, I wouldn't call an error message a crash. To me a crash is a
> segfault or something like this.)
"The build process aborted in an unexpected way". However
RSS Feed