From 16ed4f51c297ab20c62273fb16e5346ec72f01d7 Mon Sep 17 00:00:00 2001 From: Tim Wiederhake Date: Mon, 1 Jan 2024 12:22:46 +0100 Subject: Replace GCC_PRINTFLIKE with _X_ATTRIBUTE_PRINTF This silences all "function '...' might be a candidate for 'gnu_printf' format attribute" warnings. Signed-off-by: Tim Wiederhake --- src/twm.h | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/twm.h b/src/twm.h index 8786ad2..517451a 100644 --- a/src/twm.h +++ b/src/twm.h @@ -74,14 +74,6 @@ from The Open Group. #include #include -#ifndef GCC_PRINTFLIKE -#if defined(GCC_PRINTF) && !defined(printf) -#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var))) -#else -#define GCC_PRINTFLIKE(fmt,var) /*nothing*/ -#endif -#endif - #ifndef GCC_NORETURN #define GCC_NORETURN _X_NORETURN #endif @@ -402,10 +394,10 @@ NewBitmapCursor(Cursor *cp, char *source, char *mask); extern Pixmap CreateMenuIcon(int height, unsigned int *widthp, unsigned int *heightp); -extern void twmError(const char *, ...) GCC_PRINTFLIKE(1,2) GCC_NORETURN; -extern void twmWarning(const char *, ...) GCC_PRINTFLIKE(1,2); -extern void twmVerbose(const char *, ...) GCC_PRINTFLIKE(1,2); -extern void twmMessage(const char *, ...) GCC_PRINTFLIKE(1,2); +extern void twmError(const char *, ...) _X_ATTRIBUTE_PRINTF(1,2) GCC_NORETURN; +extern void twmWarning(const char *, ...) _X_ATTRIBUTE_PRINTF(1,2); +extern void twmVerbose(const char *, ...) _X_ATTRIBUTE_PRINTF(1,2); +extern void twmMessage(const char *, ...) _X_ATTRIBUTE_PRINTF(1,2); extern Bool ErrorOccurred; extern XErrorEvent LastErrorEvent; @@ -416,7 +408,7 @@ extern Bool RestartPreviousState; extern Bool GetWMState(Window w, int *statep, Window *iwp); -extern void parseWarning(const char *, ...) GCC_PRINTFLIKE(1,2); +extern void parseWarning(const char *, ...) _X_ATTRIBUTE_PRINTF(1,2); extern Atom TwmAtoms[]; -- cgit v1.2.3