J
john.coppens
I have a piece of code that calls a function like this:
722 combine_impedance(&el, f);
(gdb) print f
$15 = 12
'el' is a locally defined struct and f is locally defined as double.
One step more gives:
(gdb) s
combine_impedance (el=0x0, f=-30) at chart.c:516
516 {
The parameters are incorrect - I suspect this may have something to do
with
optimization. A few steps more gives:
(gdb) print *el
$18 = {conn = 0, typ = 4, useloss = 0, val1 = 1234, val2 = 0, z0 = 55,
vf = 0,
loss1 = 0, loss2 = 0, mhz1 = 0, mhz2 = 0, ptlst = 0x0, lnlst = 0x0}
(gdb) print f
$19 = nan(0x8000000000000)
*el is now correct, but 'f' isn't. Still optimization problem?
Needless to say, the results from the function are incorrect.
Someone has any idea how to proceed?
JohnC
722 combine_impedance(&el, f);
(gdb) print f
$15 = 12
'el' is a locally defined struct and f is locally defined as double.
One step more gives:
(gdb) s
combine_impedance (el=0x0, f=-30) at chart.c:516
516 {
The parameters are incorrect - I suspect this may have something to do
with
optimization. A few steps more gives:
(gdb) print *el
$18 = {conn = 0, typ = 4, useloss = 0, val1 = 1234, val2 = 0, z0 = 55,
vf = 0,
loss1 = 0, loss2 = 0, mhz1 = 0, mhz2 = 0, ptlst = 0x0, lnlst = 0x0}
(gdb) print f
$19 = nan(0x8000000000000)
*el is now correct, but 'f' isn't. Still optimization problem?
Needless to say, the results from the function are incorrect.
Someone has any idea how to proceed?
JohnC