aboutsummaryrefslogtreecommitdiff
path: root/nxcompshad
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-01-18 23:45:26 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-03-01 12:02:26 +0100
commit059028ce72267de69cb6b1983fc3599ee6491d9d (patch)
treef89f8082716b49177aa4401ef3a23fa83990930c /nxcompshad
parenta53c655474c96fc24e38009804291882793c2a3f (diff)
downloadnx-libs-059028ce72267de69cb6b1983fc3599ee6491d9d.tar.gz
nx-libs-059028ce72267de69cb6b1983fc3599ee6491d9d.tar.bz2
nx-libs-059028ce72267de69cb6b1983fc3599ee6491d9d.zip
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".
Diffstat (limited to 'nxcompshad')
-rw-r--r--nxcompshad/src/Logger.h13
1 files changed, 4 insertions, 9 deletions
diff --git a/nxcompshad/src/Logger.h b/nxcompshad/src/Logger.h
index 88908f717..8436c5f15 100644
--- a/nxcompshad/src/Logger.h
+++ b/nxcompshad/src/Logger.h
@@ -29,9 +29,6 @@
#include <cerrno>
#include <cstdarg>
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
-
//
// Error handling macros.
//
@@ -46,17 +43,17 @@ class Logger
{
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 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 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);
};
@@ -167,6 +164,4 @@ static inline void logDump(const char *name, const char *data, int size)
#endif
}
-#pragma GCC diagnostic pop
-
#endif /* Logger_H */