-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiling lv_log.c fails due to type limits error #690
Comments
@Ferruck Considering that we aren't likely to have 128 log levels anytime soon, I think using a signed integer type might be the cleanest method. |
@Ferruck Thank you for the clear report and suggestion! I merged your patch! |
No problem, you're welcome. |
amirgon
pushed a commit
to amirgon/lvgl
that referenced
this issue
Jan 23, 2019
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 lvgl#690
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
When compiling LittlevGL with the GCC 7.3.1 provided by Arm (
arm-bare-none-eabi
) with-Wall
,-Wextra
and-Werror
activated andLV_LOG_LEVEL
set toLV_LOG_LEVEL_TRACE
, compilation fails with the following errorbecause
level
is alv_log_level_t
(which is a typedef foruint8_t
) andLV_LOG_LEVEL_TRACE
equals0
.There are multiple possibilities how to fix this (in case you think that this is an error, too):
1
lv_log_level_t
lv_log_add()
is kinda internal and shall be used exclusively through the log macros)I'd gladly provide a patch for any of the above if you like and – again – if you think this is an issue, too, otherwise feel free to simply close this issue.
Regards
The text was updated successfully, but these errors were encountered: