Skip to content

Commit aa192f5

Browse files
committed
Fix for failing tests. gcc 4.8.3 would optimize away the assigment.
1 parent 80260bc commit aa192f5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ext/mysqlnd/mysqlnd_ps_codec.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ ps_fetch_float(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_l
195195
#ifdef HAVE_DECIMAL_FP_SUPPORT
196196
{
197197
typedef float dec32 __attribute__((mode(SD)));
198-
dec32 d32val = fval;
198+
/* volatile so the compiler will not optimize away the conversion */
199+
volatile dec32 d32val = fval;
199200

200201
/* The following cast is guaranteed to do the right thing */
201202
dval = (double) d32val;

0 commit comments

Comments
 (0)