#202: Undefined behavior in Coordinate::hashCode
------------------------------------+---------------------------------------
Reporter: mloskot | Owner: [email protected]
Type: defect | Status: new
Priority: major | Milestone:
Component: Core | Version: svn-trunk
Severity: Significant | Resolution:
Keywords: coordinate hash double |
------------------------------------+---------------------------------------
Comment (by bmharper):
Mateusz - you mentioned that this violates aliasing rules:
unsigned int HashDouble( double d )
{
unsigned int* i = (unsigned int*) &d;
return i[0] ^ i[1];
}
Can you explain further, or point me to the relevant C/++ docs?
Thanks,
Ben
ps-- Your code references &x. Should this not be &d?
--
Ticket URL: <http://trac.osgeo.org/geos/ticket/202#comment:1>
GEOS <http://geos.refractions.net/>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite
(JTS)._______________________________________________
geos-devel mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/geos-devel