[vtk-developers] [VTK 0012693]: vtkMPASReader.cxx defines global variable PI

Mantis Bug Tracker mantis at public.kitware.com
Tue Nov 1 04:53:03 EDT 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://vtk.org/Bug/view.php?id=12693 
====================================================================== 
Reported By:                Andreas Buykx
Assigned To:                
====================================================================== 
Project:                    VTK
Issue ID:                   12693
Category:                   (No Category)
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     backlog
Project:                    TBD 
Type:                       incorrect functionality 
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             2011-11-01 09:53 CET
Last Modified:              2011-11-01 09:53 CET
====================================================================== 
Summary:                    vtkMPASReader.cxx defines global variable PI
Description: 
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.

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-11-01 09:53 Andreas Buykx  New Issue                                    
======================================================================




More information about the vtk-developers mailing list