[vtkusers] global variable PI in vtkMPASReader.cxx

Andreas Buykx A.Buykx at tnodiana.com
Tue Nov 1 04:54:32 EDT 2011


Hi all,

vtk-5.8.0-source/IO/vtkMPASReader.cxx, line 104 defines a global variable PI.

double PI = 3.141592;

This global variable (of very limited precision) can easily clash with other definitions of PI, as in our case with a global PI in OpenCascade. This can easily lead to very hard to detect bugs: we spent roughly 5 man days until we found this ...

It looks like the variable declaration can safely be changed into a static declaration, hiding the variable from the global namespace.

I've just filed this as a bug report.
Kind regards,
Andreas

Andreas Buykx
Senior Software Engineer

TNO DIANA BV
Software Developers and Analysis Consultants for Civil and Geotechnical Engineering

Delftechpark 19a, 2628 XJ, Delft, The Netherlands
Tel: +31 88 34262 15 (Direct) │ Tel: +31 88 34262 00 (Switchboard) │ +31 88 34262 99 (Fax)
http://tnodiana.com<http://tnodiana.com/>

...be green keep it on screen

____________________________________________________________
TNO DIANA BV is a limited liability company registered in the trade register of the Chamber of Commerce as TNO DIANA BV with registered number 27252655.
____________________________________________________________
This e-mail and its contents are subject to the DISCLAIMER at http://tnodiana.com/content/Disclaimer
____________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111101/3d9b559b/attachment.htm>


More information about the vtkusers mailing list