Skip to content
Snippets Groups Projects
Commit 96a33d1a authored by Mara Bos's avatar Mara Bos Committed by Lorenz Meier
Browse files

Enable __attribute__((format)) on px4 logging functions.

This makes the compiler warn about invalid format strings.
parent 10c20b38
No related branches found
No related tags found
No related merge requests found
......@@ -141,8 +141,15 @@ __BEGIN_DECLS
__EXPORT extern const char *__px4_log_level_str[_PX4_LOG_LEVEL_PANIC + 1];
__EXPORT extern const char *__px4_log_level_color[_PX4_LOG_LEVEL_PANIC + 1];
__EXPORT extern void px4_backtrace(void);
__EXPORT void px4_log_modulename(int level, const char *moduleName, const char *fmt, ...);
__EXPORT void px4_log_raw(int level, const char *fmt, ...);
__EXPORT void px4_log_modulename(int level, const char *moduleName, const char *fmt, ...)
__attribute__((format(printf, 3, 4)));
__EXPORT void px4_log_raw(int level, const char *fmt, ...)
__attribute__((format(printf, 2, 3)));
#if __GNUC__
// Allow empty format strings.
#pragma GCC diagnostic ignored "-Wformat-zero-length"
#endif
__END_DECLS
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment