Commit 059028ce authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

Logger.h: remove pragma, correct attributes

Instead of using a pragma which will be valid for the whole file this only affects the functions where it is actually required and supresses "format string is not a string literal" warnings. According to GCC documentation the second attribute parameter should be 0: "For functions where the arguments are not available to be checked (such as vprintf), specify the third parameter as zero".
parent a53c6554
...@@ -29,9 +29,6 @@ ...@@ -29,9 +29,6 @@
#include <cerrno> #include <cerrno>
#include <cstdarg> #include <cstdarg>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
// //
// Error handling macros. // Error handling macros.
// //
...@@ -46,17 +43,17 @@ class Logger ...@@ -46,17 +43,17 @@ class Logger
{ {
public: public:
void user(const char *format, ...) __attribute__((format(printf, 2, 3))); void user(const char *format, ...) __attribute__((format(printf, 2, 0)));
void error(const char *name, int error); void error(const char *name, int error);
void warning(const char *name, const char *format, ...) __attribute__((format(printf, 3, 4))); void warning(const char *name, const char *format, ...) __attribute__((format(printf, 3, 0)));
void test(const char *name, const char *format, ...) __attribute__((format(printf, 3, 4))); void test(const char *name, const char *format, ...) __attribute__((format(printf, 3, 0)));
void trace(const char *name); void trace(const char *name);
void debug(const char *name, const char *format, ...) __attribute__((format(printf, 3, 4))); void debug(const char *name, const char *format, ...) __attribute__((format(printf, 3, 0)));
void dump(const char *name, const char *data, int size); void dump(const char *name, const char *data, int size);
}; };
...@@ -167,6 +164,4 @@ static inline void logDump(const char *name, const char *data, int size) ...@@ -167,6 +164,4 @@ static inline void logDump(const char *name, const char *data, int size)
#endif #endif
} }
#pragma GCC diagnostic pop
#endif /* Logger_H */ #endif /* Logger_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment