From 471342933b19bb0648d4f339be6e160545013f51 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Fri, 18 Jan 2019 22:10:54 +0100 Subject: Fix: clang does not know about gnu_printf Found via Travis CI --- nxcompshad/src/Logger.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'nxcompshad/src') diff --git a/nxcompshad/src/Logger.h b/nxcompshad/src/Logger.h index 876cb0432..e0b9997d7 100644 --- a/nxcompshad/src/Logger.h +++ b/nxcompshad/src/Logger.h @@ -46,17 +46,17 @@ class Logger { public: - void user(const char *format, ...) __attribute__((format(gnu_printf, 2, 3))); + void user(const char *format, ...) __attribute__((format(printf, 2, 3))); void error(const char *name, int error); - void warning(const char *name, const char *format, ...) __attribute__((format(gnu_printf, 3, 4))); + void warning(const char *name, const char *format, ...) __attribute__((format(printf, 3, 4))); - void test(const char *name, const char *format, ...) __attribute__((format(gnu_printf, 3, 4))); + void test(const char *name, const char *format, ...) __attribute__((format(printf, 3, 4))); void trace(const char *name); - void debug(const char *name, const char *format, ...) __attribute__((format(gnu_printf, 3, 4))); + void debug(const char *name, const char *format, ...) __attribute__((format(printf, 3, 4))); void dump(const char *name, const char *data, int size); }; -- cgit v1.2.3 From 74fe99dab760eb1bc2aa7b64ab32a19bd26baabc Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Fri, 18 Jan 2019 22:51:40 +0100 Subject: xcompshad: remove unused variables --- nxcompshad/src/X11.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'nxcompshad/src') diff --git a/nxcompshad/src/X11.h b/nxcompshad/src/X11.h index 87dd31fea..0fe8ca0de 100644 --- a/nxcompshad/src/X11.h +++ b/nxcompshad/src/X11.h @@ -77,10 +77,6 @@ class Poller : public CorePoller Damage damage_; - Region repair_; - - char damageChanges_; - XShmSegmentInfo *shminfo_; XImage *image_; -- cgit v1.2.3 From a53c655474c96fc24e38009804291882793c2a3f Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Fri, 18 Jan 2019 23:44:47 +0100 Subject: Logger.h: fix missing compiler attribute --- nxcompshad/src/Logger.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nxcompshad/src') diff --git a/nxcompshad/src/Logger.h b/nxcompshad/src/Logger.h index e0b9997d7..88908f717 100644 --- a/nxcompshad/src/Logger.h +++ b/nxcompshad/src/Logger.h @@ -68,7 +68,7 @@ static inline void logError(const char *name, int error) \ __attribute__((__unused__)); static inline void logWarning(const char *name, const char *format, ...) \ - __attribute__((__unused__)); + __attribute__((format(printf, 2, 3))) __attribute__((__unused__)); static inline void logTest(const char *name, const char *format, ...) \ __attribute__((format(printf, 2, 3))) __attribute__((__unused__)); -- cgit v1.2.3 From 059028ce72267de69cb6b1983fc3599ee6491d9d Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Fri, 18 Jan 2019 23:45:26 +0100 Subject: 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". --- nxcompshad/src/Logger.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'nxcompshad/src') 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 #include -#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 */ -- cgit v1.2.3