[geos-devel] [GEOS] #638: Recommend a static_cast around assert strings

GEOS geos-trac at osgeo.org
Thu Jul 18 12:25:57 PDT 2013


#638: Recommend a static_cast around assert strings
------------------------+---------------------------------------------------
 Reporter:  goatbar     |       Owner:  geos-devel@…              
     Type:  defect      |      Status:  new                       
 Priority:  major       |   Milestone:                            
Component:  Default     |     Version:  3.3.8                     
 Severity:  Unassigned  |    Keywords:                            
------------------------+---------------------------------------------------
 I recommend that for all asserts with strings, that they be changed to
 wrap the string in a static_cast.  Not very exciting, but it makes the
 stricter compilers happier.

 e.g. in src/geom/util/GeometryEditor.cpp

 {{{
 assert(!"SHOULD NEVER GET HERE");
 }}}

 changes to

 {{{
 assert(!static_cast<bool>("SHOULD NEVER GET HERE"));
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/geos/ticket/638>
GEOS <http://geos.refractions.net/>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).


More information about the geos-devel mailing list