[geos-devel] What's the intent of 'assert(!"should never be reached")'?

Sandro Santilli strk at keybit.net
Wed Sep 30 09:04:24 PDT 2015


On Tue, Jul 07, 2015 at 12:12:54PM -0600, Sean Gillies wrote:
> There are three places in GEOS where this assertion appears
> 
> 
> https://github.com/libgeos/libgeos/blob/c9d94c2ebb68b6b679f03dc7eabebfcd39136def/src/index/strtree/AbstractSTRtree.cpp#L371
> 
> and two them have been tripping up Shapely users on OS X. I've found that
> rebuilding GEOS with --disable-cassert solves the user problems: no assert
> exceptions raised and no other program crashes.
> 
> My question: what is the intent of these statements? If they can be safely
> ignored, as I'm doing, should they not be disabled by default?

Unless you're extending GEOS by subclassing a Boundable, such an
assert would indicate a compile issue.

--strk;


More information about the geos-devel mailing list