mirror of https://gitee.com/openkylin/glib2.0.git
39 lines
982 B
Diff
39 lines
982 B
Diff
From: Ryan Lortie <desrt@desrt.ca>
|
|
Date: Tue, 4 Mar 2014 09:20:38 -0500
|
|
Subject: timer test: use 'volatile' for locals
|
|
|
|
GCC seems to be failing to follow the letter of the C spec by allowing extra
|
|
precision in floating point values to persist across assignments which are
|
|
optimised away.
|
|
|
|
Force its hand by using 'volatile' on the locals in question.
|
|
|
|
Bug: https://gitlab.gnome.org/GNOME/glib/issues/820
|
|
Forwarded: yes
|
|
---
|
|
glib/tests/timer.c | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/glib/tests/timer.c b/glib/tests/timer.c
|
|
index 149b3af..b7a90c2 100644
|
|
--- a/glib/tests/timer.c
|
|
+++ b/glib/tests/timer.c
|
|
@@ -30,7 +30,7 @@ static void
|
|
test_timer_basic (void)
|
|
{
|
|
GTimer *timer;
|
|
- gdouble elapsed;
|
|
+ volatile gdouble elapsed;
|
|
gulong micros;
|
|
|
|
timer = g_timer_new ();
|
|
@@ -47,7 +47,7 @@ static void
|
|
test_timer_stop (void)
|
|
{
|
|
GTimer *timer;
|
|
- gdouble elapsed, elapsed2;
|
|
+ volatile gdouble elapsed, elapsed2;
|
|
|
|
timer = g_timer_new ();
|
|
|