Skip to content

Commit

Permalink
util/Compiler.h: use gnu_printf on GCC
Browse files Browse the repository at this point in the history
Fixes GCC warning on mingw.
  • Loading branch information
MaxKellermann committed Dec 11, 2023
1 parent 738a187 commit 815898c
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/util/Compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,12 @@
#define CLANG_OR_GCC_VERSION(major, minor) \
(CLANG_VERSION > 0 || GCC_CHECK_VERSION(major, minor))

#if CLANG_OR_GCC_VERSION(4,0)

/* GCC 4.x */

#ifdef __clang__
#define gcc_printf(a,b) __attribute__((format(printf, a, b)))

#elif defined(__GNUC__)
#define gcc_printf(a,b) __attribute__((format(gnu_printf, a, b)))
#else

/* generic C compiler */

#define gcc_printf(a,b)

#endif

#if defined(__GNUC__) || defined(__clang__)
Expand Down

0 comments on commit 815898c

Please sign in to comment.