Hello all;
BCB4 AMD 450M processor, 128M RAM. The following strange behaviour of the
Integrated De{*word*81}/IDE is independent of whether or not the patches are
applied. Has anyone else come across this and can supply or direct me to an
explanation and, hopefully, workround?
I have only recently installed BCB4 and have moved a project from BCB3. It
is possible that work up to the last few days would not have provoked the
incident. I have reinstalled BCB4 from clean and re-built the whole program,
with no alleviation of the phenomenon. The phenonemon was not perceived in
BCB3.
I give a summary of the problem below. I have not included actual example
code as the fault can be provoked in a number of places in the program (in
different units) and does not seem dependent on any particular code
sequence.
Summary of problem :
In several places where I have a function which manipulates float variables,
generally called from an outer loop, _if_ I place a breakpoint _in_ this
function, and execution stops on this breakpoint, then on resumption it is
almost certain that an "Invalid Floating Point Operation" Exception will be
thrown. Not necessarily on the the first FP operation, but totally
consistent on which it chooses to object to and either a statement _in_ the
function itself or in a function called by it.
If the breakpoint is placed towards the end of the function, the fault is
likely to arise on re-entry to the function, i.e., before the breakpoint is
again reached.
If the breakpoint is removed (or is made conditional) the program will run
correctly and all FP operations are correctly performed (until the break
condition is reached).
Examples of statements which will _appear_ to be in error are:
sprintf(tmp, "%9.2f", amount); // tmp is char[20]
TotBal += amount; // both floats
AnsiString FormatFloat operation
The inputs to these operations have the correct values in all cases.
If I vary the order of the FP statements in the function then the fault is
likely to occur on a different statement.
I emphasise that if the breakpoint is not placed the program works
satisfactorily.
If the breakpoint is placed at the _call_ to the function (i.e., in the
outer loop, then the fault does not occur.
I cannot see how anything in my program could cause this behaviour to occur
in different places in the program, and it seems to me that the IDE/de{*word*81}
is doing something at a breakpoint which is confusing something to do with
floating point.
Possibly related phenomenon: often, if some compiler error is reported, the
list will finish with "Illegal floating point operation" although when the
other error(s) are removed there is no such error.
Any ideas?
Derek Harvey.