Subject: [ggl] suspicious line 320 in extensions/gis/projections/proj/stere.hpp
From: Mateusz Loskot (mateusz)
Date: 2010-11-11 16:39:59
On 11/11/10 13:28, Krzysztof Czainski wrote:
> I have been playing with converting Geographic <-> Cartesian, tried
> projections. When I tried stere_ellipsoid, I found a warning on line 320.
> That was yesterday at work, and I don't remember the warning, but it said
> something about UB.
> Anyway, when I look at this line in the current (r66490) sandbox/geometry,
> it looks suspicious, so I changed it locally:
> $ svn diff stere.hpp
> Index: stere.hpp
> --- stere.hpp (wersja 66490)
> +++ stere.hpp (kopia robocza)
> @@ -316,7 +316,7 @@
> void setup_stere(Parameters& par, par_stere& proj_parm)
> proj_parm.phits = pj_param(par.params, "tlat_ts").i ?
> - proj_parm.phits = pj_param(par.params, "rlat_ts").f :
> + pj_param(par.params, "rlat_ts").f : HALFPI;
> setup(par, proj_parm);
> What do You guys think?
Great catch indeed!
I think, god bless the strict compilation flags :-)
-- Mateusz Loskot, http://mateusz.loskot.net Charter Member of OSGeo, http://osgeo.org Member of ACCU, http://accu.org
Geometry list run by mateusz at loskot.net