[QGIS-trac] [Quantum GIS] #1240: Invalid preprocessor condition testing value of GEOS_VERSION_MAJOR

Quantum GIS qgis at qgis.org
Fri Aug 22 08:34:42 EDT 2008


#1240: Invalid preprocessor condition testing value of GEOS_VERSION_MAJOR
------------------------------------------------+---------------------------
   Reporter:  mloskot                           |              Owner:  nobody
       Type:  bug                               |             Status:  new   
   Priority:  major: does not work as expected  |          Milestone:        
  Component:  Build/Install                     |            Version:  HEAD  
   Keywords:  geos preprocessor                 |   Platform_version:  10.5  
   Platform:  OS X                              |           Must_fix:  No    
Status_info:  0                                 |  
------------------------------------------------+---------------------------
 In file [source:trunk/qgis/src/core/qgsgeometry.h at 9096#L27 qgsgeometry.h],
 line 27, preprocessir #if-def testing major version number is incorrect:

 {{{
 #if GEOS_VERSION_MAJOR<3
 }}}

 If the tested macro is not defined, it always evaluates to true. Small
 test:

  * Incorrect condition due to the incompleteness
 {{{
 //#define ABC 3   // ABC not defined

 #if (ABC < 4)
 #  error XXX      // always printed, despite ABC undefined
 #endif

 int main() { return 0; }
 }}}

  * Correct #ifdef condition should include 2 tests together
 {{{
 //#define ABC 3

 #if defined(ABC) && (ABC < 4)
 #  error XXX
 #endif

 int main() { return 0; }
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/qgis/ticket/1240>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats


More information about the QGIS-trac mailing list