Package: glib2.0 / 2.50.3-2+deb9u2

0001-timer-test-use-volatile-for-locals.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From d470c2f1f64ea7460b26dd446a5007f9faf04f4f Mon Sep 17 00:00:00 2001
From: Ryan Lortie <desrt@desrt.ca>
Date: Tue, 4 Mar 2014 09:20:38 -0500
Subject: [PATCH] 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.

https://bugzilla.gnome.org/show_bug.cgi?id=722604
---
 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 cb9a268..d6938f1 100644
--- a/glib/tests/timer.c
+++ b/glib/tests/timer.c
@@ -27,7 +27,7 @@ static void
 test_timer_basic (void)
 {
   GTimer *timer;
-  gdouble elapsed;
+  volatile gdouble elapsed;
   gulong micros;
 
   timer = g_timer_new ();
@@ -44,7 +44,7 @@ static void
 test_timer_stop (void)
 {
   GTimer *timer;
-  gdouble elapsed, elapsed2;
+  volatile gdouble elapsed, elapsed2;
 
   timer = g_timer_new ();
 
-- 
1.9.0