logging: fix warning of array subscript having type char

In the count_s() function, with -Wchar-subscripts, GCC warns
about array subscript having type ‘char’ with the isalpha()
call. Since isalpha() takes an int, so do a type-cast there
to get rid of the warning.

This happens on XCC which is based on GCC 4.2.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2019-12-12 17:13:05 -08:00 committed by Anas Nashif
parent 37f94d66ab
commit 218b45b749

View file

@ -109,7 +109,7 @@ static u32_t count_s(const char *str, u32_t nargs)
while ((curr = *str++) && arg < nargs) {
if (curr == '%') {
arm = !arm;
} else if (arm && isalpha(curr)) {
} else if (arm && isalpha((int)curr)) {
if (curr == 's') {
mask |= BIT(arg);
}