Skip to content

clang_nowarn_sim_attr_printf

Tsukasa OI edited this page Oct 30, 2022 · 6 revisions

Clang: Suppress warnings if built with Clang (sim: printf-like functions)

Based On

Issue Solved

Clang generates a warning if the format string of a printf-like function is not a literal (-Wformat-nonliteral). On the default configuration, it causes a build failure (unless --disable-werror is specified).

To avoid warnings on the printf-like wrapper, it requires proper __attribute__((format)) and we have ATTRIBUTE_PRINTF macro for this reason.

This patchset adds ATTRIBUTE_PRINTF to all function declarations that require ATTRIBUTE_PRINTF macro.

Clone this wiki locally