From 75f3198c3d136f5e542f2a0e100d5f7189901a94 Mon Sep 17 00:00:00 2001 From: Philipp Trommler Date: Wed, 2 Jan 2019 15:18:02 +0100 Subject: [PATCH] lv_log: Fix type limits error When building LittlevGL with a rather recent compiler (tested with GCC 7.3.1 provided by Arm), `-Wall`, `-Wextra` and `-Werror` activated and `LV_LOG_LEVEL` set to `LV_LOG_LEVEL_TRACE`, compilation fails due to a type limits error in lv_log.c if(level >= LV_LOG_LEVEL) { ^~ because the comparison is always true, since level is a `lv_log_level_t` (that is a typedef for `uint8_t`) and `LV_LOG_LEVEL_TRACE` equals 0. Fix that by making `lv_log_level_t` a typedef to `int8_t`. Fixes #690 --- lv_misc/lv_log.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lv_misc/lv_log.h b/lv_misc/lv_log.h index 1b2fa9863..9e845a27a 100644 --- a/lv_misc/lv_log.h +++ b/lv_misc/lv_log.h @@ -32,7 +32,7 @@ extern "C" { #define LV_LOG_LEVEL_ERROR 3 /*Only critical issue, when the system may fail*/ #define _LV_LOG_LEVEL_NUM 4 -typedef uint8_t lv_log_level_t; +typedef int8_t lv_log_level_t; #if USE_LV_LOG /**********************