From bb4dd3f5c6cf9e87895adc97ef0d45bb0b35ee41 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Wed, 1 Feb 2017 21:51:58 -0500 Subject: [PATCH] wmgtemp: Fix -Waggressive-loop-optimizations compiler warning. In particular, the cpu_history array has length 59, so when i = 58, cpu_history[i+1] is undefined. From http://sources.debian.net/src/wmgtemp/1.1-3/debian/patches/fix_-Waggressive-loop-optimizations.patch/ --- wmgtemp/src/wmgtemp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wmgtemp/src/wmgtemp.c b/wmgtemp/src/wmgtemp.c index 02d75a5..f4418a6 100644 --- a/wmgtemp/src/wmgtemp.c +++ b/wmgtemp/src/wmgtemp.c @@ -428,7 +428,7 @@ void update_sensor_data() { double sys_high = highest_temp(sys_history); /* Shift the arrays */ - for(i = 0; i < 59; i++) { + for(i = 0; i < 58; i++) { cpu_history[i] = cpu_history[i + 1]; sys_history[i] = sys_history[i + 1]; }