[postgis-tickets] r14451 - Prevent gcc from optimizing away minimum bounding circle test fix

Daniel Baston dbaston at gmail.com
Sun Nov 29 17:47:03 PST 2015


Author: dbaston
Date: 2015-11-29 17:47:03 -0800 (Sun, 29 Nov 2015)
New Revision: 14451

Modified:
   trunk/liblwgeom/cunit/cu_minimum_bounding_circle.c
Log:
Prevent gcc from optimizing away minimum bounding circle test fix

Modified: trunk/liblwgeom/cunit/cu_minimum_bounding_circle.c
===================================================================
--- trunk/liblwgeom/cunit/cu_minimum_bounding_circle.c	2015-11-30 01:16:03 UTC (rev 14450)
+++ trunk/liblwgeom/cunit/cu_minimum_bounding_circle.c	2015-11-30 01:47:03 UTC (rev 14451)
@@ -30,7 +30,7 @@
 		/* We need to store the distance in a variable before the assert so that 
 		 * it is rounded from its 80-bit representation (on x86) down to 64 bits. 
 		 * */
-		double d = distance2d_pt_pt(result->center, &p);
+		volatile double d = distance2d_pt_pt(result->center, &p);
 
 		CU_ASSERT_TRUE(d <= result->radius);
 	}



More information about the postgis-tickets mailing list