gcc has a "format" attribute to declare that a function or method accepts a printf-like format string and variable arguments. This allows the compiler to check the type of arguments. For example a warning is emitted if attempting to pass an std::string without .c_str() call.
log4cpp does not use this attribute in places where it could. As a result, the code compile without warnings and problems are found only at runtime.
@pulkomandy, thanks for highlighting that.
The issue is addressed with 007e1a39add173f6fc97e61a4cc91cfd4081d542 and will be included into next release.
__attribute__((format(printf, fmt, arg)))is utilized for GCC/ClangLast edit: Alexander Perepelkin 2026-03-17