warnings when invoking zbrent(root.h)
sean88
11-15-2014, 09:40 AM
When I call the root finding routine zbrent(header root.h).
GCC(4.9.2) always gives warning:
root.h: In function 'Doub zbrent(T&, Doub, Doub, Doub)'
root.h:202:21: warning: 'e' may be used uninitialized in this function
Saul Teukolsky
11-16-2014, 01:28 PM
There are quite a few recipes that will give this kind of warning with newer compilers. We believe all of them can safely be ignored.
Best,
Saul Teukolsky
sean88
11-17-2014, 10:46 AM
There are quite a few recipes that will give this kind of warning with newer compilers. We believe all of them can safely be ignored.
Best,
Saul Teukolsky
for this specific warning, is there any reason 'e' is not initialized?
Saul Teukolsky
12-01-2014, 03:42 PM
Hi Sean,
In this case, e could be initialized to zero. The reason it doesn't matter is that on the first iteration, fc is equal to fb. Thus the first if statement in the loop is true and e gets initialized there.
Best,
Saul Teukolsky