kuhn@rhlab.UUCP (Michael Kuhn) writes:
>Having just received 4GL release 4.12UE1, I was briefly delighted
>to see a number of problems disappear. Specifically bug #15976
>and other unknown problems (suspect memory allocation) that have
>left my executables in a core dumpy mode.
Good.
>In less than 4 hours after 28 hours of recompliation and linking-
>one set of problems was traded for another; the worst of which so
>far is attached.
Bad.
>What else is going to come out of this pandora's box?
Dunno...
>Does anybody else feel frustrated with this?
Me too. This is bug B31948. It is fixed in the forthcoming 4.13/6.01
releases.
The fix is to change the lines in the generated C so that instead of
reading (for money variables -- probably 6.00 only):
popmon(&mon_var);
status = (status < 0 && chkprec(&mon_var, 3076)) ? -1226 : status;
it reads:
popmon(&mon_var);
if (status == 0 && chkprec(&mon_var, 3076)) status = -1226;
Similarly for decimal variables (and probably money variables in 4.12):
popdec(&dec_var);
status = (status < 0 && chkprec(&dec_var, 3076)) ? -1226 : status;
it reads:
popdec(&dec_var);
if (status == 0 && chkprec(&dec_var, 3076)) status = -1226;
This could be done by amending the c4gl script to add (yet another)
processing step, this time using sed on the .c file. Add the lines
below immediately after the line "P4=1":
tmp=${TMPDIR:-/tmp}/c4gl.$$
trap 'rm -f ${tmp}.1; exit 3' 1 2 3 13 15
After each use of $FGLC3 (there are two of them), add:
sed 's/status = (status < 0 && chkprec(&\\(.*\\), \\([0-9]*\\))) ? -1226 : \\
status;/if (status == 0 && chkprec(&\\1, \\2)) status = -1226;/' \\
$FBASE.c > ${tmp}.1
mv ${tmp}.1 $FBASE.c
This is nothing other than a ghastly hack, but it will get around the problem.
There are undoubtedly neater ways of packaging this, but it will get you out
of the fix you are in.
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>