From aa192f57c9d867ab3d7be69c7f269cfd7a10d14f Mon Sep 17 00:00:00 2001 From: Keyur Govande Date: Fri, 26 Dec 2014 20:36:19 +0000 Subject: [PATCH] Fix for failing tests. gcc 4.8.3 would optimize away the assigment. --- ext/mysqlnd/mysqlnd_ps_codec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/mysqlnd/mysqlnd_ps_codec.c b/ext/mysqlnd/mysqlnd_ps_codec.c index d96091210b..a57ff5d6a4 100644 --- a/ext/mysqlnd/mysqlnd_ps_codec.c +++ b/ext/mysqlnd/mysqlnd_ps_codec.c @@ -195,7 +195,8 @@ ps_fetch_float(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_l #ifdef HAVE_DECIMAL_FP_SUPPORT { typedef float dec32 __attribute__((mode(SD))); - dec32 d32val = fval; + /* volatile so the compiler will not optimize away the conversion */ + volatile dec32 d32val = fval; /* The following cast is guaranteed to do the right thing */ dval = (double) d32val; -- 2.50.1