From 6185da3d769cc786490b9047dd30367575fb0f06 Mon Sep 17 00:00:00 2001 From: "Man, Jianting (Meco)" <920369182@qq.com> Date: Wed, 30 Mar 2022 07:12:39 -0400 Subject: [PATCH] fix(Keil-AC5): slience warnings in Keil-AC5 (#3221) * fix(Keil-AC5): slience warnings in Keil-AC5 * Update SConscript * Update src/misc/lv_types.h Co-authored-by: embeddedt <42941056+embeddedt@users.noreply.github.com> Co-authored-by: embeddedt <42941056+embeddedt@users.noreply.github.com> --- env_support/rt-thread/SConscript | 6 ++---- src/misc/lv_types.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/env_support/rt-thread/SConscript b/env_support/rt-thread/SConscript index 567da0290..defae78ff 100644 --- a/env_support/rt-thread/SConscript +++ b/env_support/rt-thread/SConscript @@ -53,12 +53,10 @@ if GetDepend('PKG_USING_LVGL_DEMOS'): inc = inc + [current_path] LOCAL_CFLAGS = '' -if rtconfig.PLATFORM == 'gcc': # GCC +if rtconfig.PLATFORM == 'gcc' or rtconfig.PLATFORM == 'armclang': # GCC or Keil AC6 LOCAL_CFLAGS += ' -std=c99' elif rtconfig.PLATFORM == 'armcc': # Keil AC5 - LOCAL_CFLAGS += ' --c99 --gnu -g -W' -elif rtconfig.PLATFORM == 'armclang': # Keil AC6 - LOCAL_CFLAGS += ' -std=c99 -g -w' + LOCAL_CFLAGS += ' --c99 --gnu' group = group + DefineGroup('LVGL', src, depend = ['PKG_USING_LVGL'], CPPPATH = inc, LOCAL_CFLAGS = LOCAL_CFLAGS) diff --git a/src/misc/lv_types.h b/src/misc/lv_types.h index 9f8ef4ca6..84aee1030 100644 --- a/src/misc/lv_types.h +++ b/src/misc/lv_types.h @@ -77,7 +77,7 @@ typedef uint32_t lv_uintptr_t; #define _LV_CONCAT3(x, y, z) x ## y ## z #define LV_CONCAT3(x, y, z) _LV_CONCAT3(x, y, z) -#if defined(PYCPARSER) +#if defined(PYCPARSER) || defined(__CC_ARM) #define LV_FORMAT_ATTRIBUTE(fmtstr, vararg) #elif defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 4) || __GNUC__ > 4) #define LV_FORMAT_ATTRIBUTE(fmtstr, vararg) __attribute__((format(gnu_printf, fmtstr, vararg)))