sparse: fix all errors

sparse complains about cbprintf incompatible callback type and
incorrect size of struct __va_list. Add exceptions to silence those
errors.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This commit is contained in:
Guennadi Liakhovetski 2022-03-16 16:48:23 +01:00 committed by Anas Nashif
commit 462bd8abc2
2 changed files with 13 additions and 1 deletions

View file

@ -155,7 +155,11 @@ BUILD_ASSERT(Z_IS_POW2(CBPRINTF_PACKAGE_ALIGNMENT));
* int, or a negative error code that will be returned from
* cbprintf().
*/
#ifdef __CHECKER__
typedef int (*cbprintf_cb)(int c, void *ctx);
#else
typedef int (*cbprintf_cb)(/* int c, void *ctx */);
#endif
/** @brief Signature for a external formatter function identical to cbvprintf.
*

View file

@ -38,7 +38,15 @@ static inline bool ptr_in_rodata(const char *addr)
* va_list creation
*/
#if defined(__aarch64__)
#if defined(__CHECKER__)
static int cbprintf_via_va_list(cbprintf_cb out,
cbvprintf_exteral_formatter_func formatter,
void *ctx,
const char *fmt, void *buf)
{
return 0;
}
#elif defined(__aarch64__)
/*
* Reference:
*