Menu

#155 Logging functions are not declared with printf-like "format" function attribute

Feature Request
open
nobody
None
5
2021-04-12
2021-04-12
No

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.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.